Forum Moderators: bakedjake

Message Too Old, No Replies

kill script

         

iceman42

3:49 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



no i dont have a grudge against anyone ;)

I have a java app that occasionally dies, and so i need to build in a check on my shutdown script to check if the java process is hanging and if it is I need to kill it.

Anyone have an idea?

jatar_k

3:50 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



shell script?

iceman42

4:04 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



Yes, sorry.

trillianjedi

4:08 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can think of two options:-

1. Tell it to stop.
2. Sleep for a bit
3. Grep the output of a PS AX
4. If it's still there issue a killall -9 ....

Or just (this one's ugly, but defensive ;-))

1. Tell it to stop.
2. Sleep for a bit.
3. Issue a killall -9 anyway.

To the best of my knowledge I don't believe that issuing a killall on a process that isn't actually running does any harm other than output an error to the console.

TJ