Computing.Net > Forums > Unix > using nohup leaving extra processes

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

using nohup leaving extra processes

Reply to Message Icon

Name: Rorgg
Date: July 30, 2003 at 11:33:55 Pacific
OS: Solaris 8
CPU/Ram: E12K, 48 GB
Comment:

Here's the skinny -- I have a ksh script that does a check for an error condition every couple hours. If it finds the error, I have it break its loop, mail out the warning, then call itself with a parameter to continue scanning.

So...

#!/usr/bin/ksh
while [[ condition ok ]]
do
check for bad thing
done
mailx -s "Bad bad things" blah@blah.com
/usr/scripts/thisfile.ksh $someparam
exit

And I launch it with nohup thisfile.ksh &

my problem is that each time the error condition occurs, it launches correctly, but the launch of the new instance of the script doesn't kill off the original one, so I have 2 or more thisfile.ksh running, none of which are doing anything except the newest.

Any easy way to either exit into a new script, or force it to launch the new script and continue going so the first script will hit its "exit" line?




Sponsored Link
Ads by Google

Response Number 1
Name: WilliamRobertson
Date: July 30, 2003 at 16:02:10 Pacific
Reply:

Might be better if it didn't break out of its loop, e.g:

while [[ condition ok ]]
do
if bad thing
then
do mail thing
fi
done

...or even leave the loop to cron, and just do something like:

if bad thing
then
do mail thing
fi


0

Response Number 2
Name: Rorgg
Date: July 31, 2003 at 10:09:44 Pacific
Reply:

Hmm the second would require me to leave behind a text file to check for the "ok" condition, but just leaving it in a loop with an if's a definite possibility.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: using nohup leaving extra processes

Disconnecting a process-session www.computing.net/answers/unix/disconnecting-a-processsession/6974.html

Processes and Pipelining Unix www.computing.net/answers/unix/processes-and-pipelining-unix/6734.html

listing processes www.computing.net/answers/unix/listing-processes/4864.html