Monday, 19 August 2013

Starting unix background process maintaining the order

Starting unix background process maintaining the order

I have a script which starts many processes in background and uses nohup
to make sure these processes keeps on running -
nohup "./$__service_script1.pl" $__service_args < /dev/null >
/var/log/$__service_name.log 2>&1 &
The problem is its important for me to make sure that processes starts in
the order of their invocation. Is their a way to wait until the process
has definitely started before attempting to start another process?
I tried wait, but it waits till the process is finished, I just want to
make sure that process has started. Probably the simplest solution would
be to put sleep for a few seconds in between processes, is there a better
solution ?
Thanks

No comments:

Post a Comment