Re: Scripting - problems with script chaining, scripts that should finish stay in ps list
- From: Bill Marcum <marcumbill@xxxxxxxxxxxxx>
- Date: Tue, 28 Oct 2008 20:08:04 +0100 (CET)
On 2008-10-28, Fu <futung.cheng@xxxxxxxxx> wrote:
Hi,[init_monitor.sh]
My script setup is something like:
daemon.sh -> restart.bash -> init_monitor.sh -> monitor.sh ->
start_tomcat.sh
After the chain is complete and tomcat is running my ps list looks
like:
myuser 26196 1 0 09:48 ? 00:00:00 SCREEN -d -m nice
nohup ./init_monitor
myuser 26197 26196 0 09:48 pts/0 00:00:00 /bin/bash ./
init_monitor.sh
myuser 26206 26197 0 09:48 pts/0 00:00:00 /bin/bash ./monitor.sh
myuser 26439 1 0 09:49 pts/0 00:00:00 /usr/local/jdk1.6.0/bin/
java ...
... [the remainer of the tomcat java processes]
Now I'd like this to be cleaner and have really only two process
listed but I'll settle for widdling down the script chain from the ps
list. The script that should exit here is the init_monitor script.
Here are the list of the execute commands in each of the scripts:
#./daemon.sh
[daemon.sh]
${MYBASEDIR}/bin/restart.bash
[restart.bash]
exec screen -d -m nice nohup ./init_monitor.sh
[init_monitor.sh]
./monitor.sh
[monitor.sh]
java
Some Background Information
The chaining is done because only some of the components in the chain
are code that belongs to me. The other code like the tomcat startup
file ships with different products and I like to make my
customizations outside of their files to make upgrading easier. I use
the screen command so that if I launch this script chain remotely the
process doesn't hangup. I tried using nohup for this but didn't have
any luck. That portion could also be improved but for now I'll settle
for figuring out how to get init_monitor.sh to not show up in the
process list and terminate.
exec ./monitor.sh
--
They can't stop us... we're on a mission from God!
-- The Blues Brothers
.
- References:
- Prev by Date: Scripting - problems with script chaining, scripts that should finish stay in ps list
- Next by Date: Re: a tool for computing time spent in front of PC?
- Previous by thread: Scripting - problems with script chaining, scripts that should finish stay in ps list
- Next by thread: record DVD from VHS?
- Index(es):
Relevant Pages
|