[apple.aux] can't get /usr/lib/uucp/uudemon.hr to run correctly from cron

jrg@Apple.COM (John R. Galloway Jr.) (06/08/90)

	In the continuing war of me against netland, (I love A/UX 2.0, but
would love to do something cruel & disgusting to uucp/sendmail/etc) I am
currently in a battle with cron (maybe).  I can receive and send mail just fine
(the from address is still my uucp address instead of my internet address, but
I've given up on that battle for the moment).  It gets sent out to my sponsoring
site (fernwood) via uuxp and all is well, as long as I (as root) execute uucico
(or /usr/lib/uucp/uudemon.hr) by hand from a command shell.  If I set cron
up to do so automatically, files are pulled in, but something goes wrong when
the X.* files are processed as shown below.  I have tried making
/usr/lib/uucp/uuxqt a shell script which saves the files and then executes
the real uuxqt, but that does not work (and perhaps would not help anyway).
Adding a -x9 to the uucico line in uudemon.hr shows no problems (which makes
sense since the uucp part seems to work, and rmail doesn't have any debug/diag
switches, that I know of)  I also have alteered uudemon.hr so the shell vars/env
is identical to that i get when logged in as root, still no help.  Does anyone
know what this is?

CONTENTS OF /usr/spool/uucp/LOGFILE on errant mail processing:
fernwood!uucp (6/7-22:07:06) (C,4302,0) OK (DIRECT tty90 0)
fernwood!uucp (6/7-22:07:38) (C,4302,0) SUCCEEDED (call to fernwood )
fernwood!uucp (6/7-22:07:46) (C,4302,0) OK (startup)
fernwood!uucp (6/7-22:07:48) (C,4302,0) REQUESTED (S D.fernw2a88185 D.fernw2a881
85 root)
fernwood!uucp (6/7-22:07:52) (C,4302,1) REQUESTED (S D.gallo225f4ab X.gallowaN22
5f root)
fernwood!uucp (6/7-22:07:56) (C,4302,2) OK (conversation complete  tty90 50)
fernwood!uucp (6/7-22:07:57) (Q,4305,0) root XQT (rmail jrg@galloway.sj.ca.us )
fernwood!uucp (6/7-22:07:58) (Q,4305,0) ret (1000) from fernwood!root (MAIL FAIL
)
fernwood!daemon (6/7-22:08:01) (X,4313,0) XQT QUE'D (rmail root@fernwood.UUCP )

CONTENTS of the D.* file enqueued as the last item above is:
From root  Thu Jun  7 22:07:59 1990 remote from galloway
Received: by galloway.sj.ca.us (5.61/SMI-3.2)
        id AA04310; Thu, 7 Jun 90 22:07:59 PDT,
Date: Thu, 7 Jun 90 22:07:59 PDT
From: galloway!root
Message-Id: <9006080507.AA04310@galloway.sj.ca.us>
To: fernwood!root

Mail failed (PATH=/bin:/usr/bin LOGNAME=uucp TZ=`/bin/cat rmail jrg@galloway.sj.
ca.us ).  Letter returned to sender.

The particular mail that cuased this problem was sent form apple.com to
jrg@galloway.sj.ca.us and is processed fine if /usr/lib/uucp/uudemon.hr is
executed on the command line in a command shell instead of from cron.  

CONTENTS of crontab file:
7 4,10,16,22 * * 1,2,3,4,5,6 /usr/lib/uucp/uudemon.hr
30 3 * * 1,2,3,4,5,6 /usr/lib/uucp/uudemon.day
0 9 * * 0 /usr/lib/uucp/uudemon.wk

CONTENTS of /usr/lib/uucp/uudemon.hr:
#!/bin/sh
:
: uudemon.hr
:
#       @(#)uudemon.hr  UniPlus V.2.1.2 (UniSoft 1.2)
# 'perform every 6 hours on the 7-minute mark'
# Copyright 1988 Apple Computer, Inc.
LOGNAME=uucp
export LOGNAME
PATH=/bin:/usr/bin:/usr/ucb:/mac/bin:/etc:/usr/etc:/usr/lib/uucp:.
export PATH
cd /usr/spool/uucp
/usr/lib/uucp/uucico -r1 -sfernwood

thanks for any and all help.
	-jrg

-- 
internet     jrg@apple.com      John R. Galloway, Jr.
(soon to be) jrg@galloway.sj.ca.us
applelink    d3413              CEO..receptionist         795 Beaver Creek Way
human       (408) 259-2490      Galloway Research         San Jose, CA  95133

These are my views, NOT Apple's, I am a GUEST here, not an employee!!

rmtodd@servalan.uucp (Richard Todd) (06/09/90)

Note: I don't have A/UX 2.0, so all my replies below are based on 1.1.  I'm
assuming that the A/UX 2.0 uucp is bug-for-bug compatible with the 1.1 one :-)

jrg@Apple.COM (John R. Galloway Jr.) writes:
>	In the continuing war of me against netland, (I love A/UX 2.0, but
>would love to do something cruel & disgusting to uucp/sendmail/etc) I am
  Don't worry, *everybody* wants to do something cruel and disgusting with 
sendmail :-)

>currently in a battle with cron (maybe).  I can receive and send mail just fine
>(the from address is still my uucp address instead of my internet address, but
>I've given up on that battle for the moment).  It gets sent out to my sponsoring
Hmm...this is probably a problem with sendmail somewhere; at least, I quit 
seeing it when I started using Smail 2.5 and Deliver to handle my mail.  I 
recommend this setup if you're a uucp-only site; obviously, if you need the
SMTP-handling capability of sendmail, you'll either have to get sendmail and
smail 2.5 to cooperate (supposedly this is possible, but I've never met anyone
who understood sendmail.cf well enough to do it!)  or try one of the Smail 3.0
alpha releases that's floating around out there.


>site (fernwood) via uuxp and all is well, as long as I (as root) execute uucico
>(or /usr/lib/uucp/uudemon.hr) by hand from a command shell.  If I set cron
>up to do so automatically, files are pulled in, but something goes wrong when
>the X.* files are processed as shown below.  I have tried making

/usr/lib/uucp/uuxqt is known (at least under 1.1) to freak severely (start
eating queued jobs without trace) if the TZ environment variable is not set.
Why does it do this? Beats me; after all, the /etc/zoneinfo/localtime link is
there *specifically* to tell what the default timezone is so programs won't
need the TZ env variable except in special cases.  
  Anyway, cron does *not* set the TZ env. variable, but the default .profile
files supplied in A/UX do, so uuxqt always works when run from your login
shell, but not from the cron job.  Here's the script I use for polling uokmax;
you'll probably want to change the first (blank) line to read "#!/bin/sh", 
since the #! construct is available in 2.0...
-----

# This shouldn't be necessary as uucico is *supposed* to check for lock
# files.
# (Note: lock files seem to work in 1.1)
TZ=CST6CDT;export TZ
#if [ ! -f /usr/spool/uucp/LCK..uokmax ]
#then
        /usr/lib/uucp/uucico -r1 -suokmax
#fi
-----
(The commented-out portions were a work-around for a bug in A/UX 1.0 UUCP, 
which didn't check for lock files properly.  Made life interesting when you
had 2 uucicos talking to the same machine over the same modem...)
--
Richard Todd	rmtodd@uokmax.ecn.uoknor.edu  rmtodd@chinet.chi.il.us
	rmtodd@servalan.uucp

jrg@Apple.COM (John R. Galloway Jr.) (06/09/90)

In article <1990Jun8.174503.3125@servalan.uucp>, rmtodd@servalan.uucp (Richard Todd) writes:
> Note: I don't have A/UX 2.0, so all my replies below are based on 1.1.  I'm
> assuming that the A/UX 2.0 uucp is bug-for-bug compatible with the 1.1 one :-)
> 
> jrg@Apple.COM (John R. Galloway Jr.) writes:
> > [a sad saga of how i could not get cron to execute uucp stuff]
> 
> /usr/lib/uucp/uuxqt is known (at least under 1.1) to freak severely (start
> eating queued jobs without trace) if the TZ environment variable is not set.
> Why does it do this? Beats me; after all, the /etc/zoneinfo/localtime link is
> there *specifically* to tell what the default timezone is so programs won't
> need the TZ env variable except in special cases.  
>   Anyway, cron does *not* set the TZ env. variable, but the default .profile
> files supplied in A/UX do, so uuxqt always works when run from your login
> shell, but not from the cron job.  Here's the script I use for polling uokmax;
> you'll probably want to change the first (blank) line to read "#!/bin/sh", 
> since the #! construct is available in 2.0...
> --
> Richard Todd	rmtodd@uokmax.ecn.uoknor.edu  rmtodd@chinet.chi.il.us
> 	rmtodd@servalan.uucp

YES!!! this was it, setting up TZ in the various scripts made it all work. 
Thanks Richard.
	-jrg

-- 
internet     jrg@apple.com      John R. Galloway, Jr.
(soon to be) jrg@galloway.sj.ca.us
applelink    d3413              CEO..receptionist         795 Beaver Creek Way
human       (408) 259-2490      Galloway Research         San Jose, CA  95133

These are my views, NOT Apple's, I am a GUEST here, not an employee!!