views:

18

answers:

1
+1  A: 

killproc will terminate programs in the process list which match the name $NAME

Strictly speaking this is in your case java .

If it is the only java process you can go and put java in $NAME

If you run other java services you have to find another way to stop your java process, e.g. putting the PID in the /var/lock/subsys/$NAME file and then killing the process using the pid.

On at least debian there is a nice tool which helps with this, but I am not sure it exists for redhat.

Peter Tillemans
Thanks but, the problem is, if I want to get the pid, i get empty string in RETVAl variable. daemon java ... RETVAL=$?
fatnjazzy
I was looking up the tool : daemontools. Apparently it is developped for fedora : http://directory.fedoraproject.org/wiki/Howto:Daemontools . You have to play a bit with the options. I have been using this for a variety of java servers and this works really nice.
Peter Tillemans