[ale] cron vs shell

James P. Kinney III jkinney at localnetsolutions.com
Sun Aug 10 13:45:48 EDT 2003


On Sun, 2003-08-10 at 12:12, Jonathan Rickman wrote:
> On Sunday 10 August 2003 10:12, James P. Kinney III wrote:
> 
> > After setting up some variables and getting a list of names and machines
> > to work on, the script uses ssh to run a remote command to stop a
> > process, the is scp's the log file from that process to a common
> > location. Then it restarts the remote machine.
> >
> > It hangs waiting for the process stop to finish when run as a cron job.
> > It doesn't when run from the command line.
> >
> > What is the difference between the two environments such that a process
> > stop request will never see it end? I have absolute paths for all the
> > commands.
> 
> I can't answer your specific question, but I have run into this before and 
> ended up using the master script to kick off the slave script (if you know 
> what I mean) to avoid this. It was a similar situation involving log 
> transfers via scp. I had to break the script up and put the functional part 
> on the remote machine itself, then use the cron job on the central machine 
> to execute. Makes updates difficult, but it works. Some folks suggested I 
> try csh as opposed to sh, but that had no impact. I finally gave up due to 
> time constraints, and never got around to fiddling with it any more.

Thanks Jonathan. That's pretty much what I was starting from, a master
script in cron that execute a slave script on the remote machine.
Unfortunately, the test window on this is limited (@#^ production
machine!). I'm hoping that making the remote shutdown a nohup process
and adding a sleep call to the master script will make this work. 

It's weird how even with setting shell environments by executing the
remote bashrc and profiles still won't let the different pieces talk
properly. I've done this in both perl and bash and both have the same
results.

The real stinker part is when I run the test version it works OK. The
test version is the exact same script but with only one machine instead
of 4. The test machine is one of the 4 in the full version. Both are
using the same loop, variables and everything?!
-- 
James P. Kinney III          \Changing the mobile computing world/
CEO & Director of Engineering \          one Linux user         /
Local Net Solutions,LLC        \           at a time.          /
770-493-8244                    \.___________________________./
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics) <jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7 

 This is a digitally signed message part




More information about the Ale mailing list