WOOHOO!!!!! SUCCESS!!!!!<br><br>It was the I/O redirect with script messing up inside a redirected cron environment<br><br>do_process_foo param 1 param2 >> $log_file 2>&1<br><br>What a brilliantly simple thing that is reliable and stupid easy.<br>
<br>Until I have to come along and live up the nickname Aaron and Jeff gave me "The OverEngineer"<br><br>sheesh....<br><br><div class="gmail_quote">On Wed, Dec 16, 2009 at 8:43 PM, Jim Kinney <span dir="ltr"><<a href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I follow you. Yes, I am running scripts not -exec 'ing external scripts.<br>cd foo<br>script -a -c "./bar.sh param1 param2" "$log_file<br>
<br>wash, rinse, repeat...<br><br>It really is a difference between how processes are handled between the two different environment of a regular login and a cron job. I'm rewriting my logger to be basic bash I/O redirects. I think that will resolve the nasty looping processes. script is designed to be able to replay process. Tht's probably not a good thing to have as an automated function :-)<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Wed, Dec 16, 2009 at 8:32 PM, Ed Cashin <span dir="ltr"><<a href="mailto:ecashin@noserose.net" target="_blank">ecashin@noserose.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Wed, Dec 16, 2009 at 6:49 PM, Jim Kinney <<a href="mailto:jim.kinney@gmail.com" target="_blank">jim.kinney@gmail.com</a>> wrote:<br>
> script runs all hunky-dorey in userland.<br>
><br>
> so time to put it into cron. To cover my bases for inferior cron<br>
> environemnt, the first thing the script does is . ~/.bash_profile which in<br>
> turn runs ~/.bash_rc which runs /etc/bashrc<br>
<br>
</div>If you are "running" scripts, you're creating new bash processes, but<br>
if you use exec instead, you'll replace the running process with a new<br>
one.<br>
<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ cat /tmp/count-procs<br>
#! /bin/sh<br>
ps ax | wc -l<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ cat /tmp/test-run<br>
/tmp/count-procs<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ sh /tmp/test-run<br>
52<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ cat /tmp/test-exec<br>
exec /tmp/count-procs<br>
ecashin@Ed-Cashins-MacBook-Pro ~$ sh /tmp/test-exec<br>
51<br>
ecashin@Ed-Cashins-MacBook-Pro ~$<br>
<div><br>
...<br>
> Except somehow it now spawns _2_ copies of the running process and the race<br>
> is on! <insert appropriate swearing here><br>
<br>
</div>Do the above comments seem relevant? I can't really tell if that's all<br>
there is to it.<br>
<font color="#888888"><br>
--<br>
Ed Cashin <<a href="mailto:ecashin@noserose.net" target="_blank">ecashin@noserose.net</a>><br>
<a href="http://noserose.net/e/" target="_blank">http://noserose.net/e/</a><br>
<a href="http://www.coraid.com/" target="_blank">http://www.coraid.com/</a><br>
</font><div><div></div><div>_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org" target="_blank">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><div><div></div><div class="h5">-- <br>-- <br>James P. Kinney III<br>Actively in pursuit of Life, Liberty and Happiness <br><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III<br>Actively in pursuit of Life, Liberty and Happiness <br><br>