- To: Peter Chubb <peter@xxxxxxxxxxxxxxxxxx>
- Subject: Re: [SLUG] cron troubles
- From: Howard Lowndes <lannet@xxxxxxxxxxxxx>
- Date: Wed Dec 11 16:38:02 2002
- Cc: Mail List - SLUG <slug@xxxxxxxxxxx>
On Wed, 11 Dec 2002, Peter Chubb wrote:
> >>>>> "Howard" == Howard Lowndes <lannet@xxxxxxxxxxxxx> writes:
>
> Howard> I have one box that has a problem running cron jobs. The jobs
> Howard> start OK, but never complete. If I run the job from the
> Howard> command line then the job runs OK, so it's not a problem with
> Howard> the command script, but with crond.
>
> The only time I've had that problem was when the job was assuming that
> stdin was a tty. Cron (I think) closes stdin.
>
> Does the job run if you redirect its stdin to /dev/null ??
> Does it hang on the command line if you close stdin? ( sh job <&- )
It looks like you have something there Peter. At the command line:
job <-runs OK
sh job <-runs OK
job <&- <-hangs
sh job <&- <-hangs
When I do Crtl-C to break the hanging jobs then that seems to release them
and they complete.
This particular job has a piece in it which goes and does an ssh and an
scp to another box as part of the script. The script used to work, but I
think has been broken since I upgraded the other box. The ssh and the scp
are under unpassworded keys so it shouldn't be looking for stdin anyway.
Any ideas on how to fix it? I have tried both the -n and the -o
"BatchMode yes" options to ssh without success.
--
Howard.
LANNet Computing Associates - Your Linux people
Contact detail at http://www.lannetlinux.com
"Flatter government, not fatter government." - me
Get rid of the Australian states.
------------------------------------------
If electricity comes from electrons, does morality come from morons?