How to kill a java process under Solaris?
843798Apr 25 2002 — edited Apr 30 2002Hi, All:
I need some help here. I am not sure if this is the right place since my question is more Unix related.
I need to write a RC script for a java app. I need to provide start and stop service in my script.
For start service
start) my_app &
Then how can I kill it? Because there are other java processes on the server, I cannot use
ps -ef | grep java to determine the PID of my app.
And 'echo $$' only returns the PID of the shell that launches my app. That is $$ has the PPID of
my java process instead of PID. When I kill that PPID, my app's PPID will become 1.
So can anyone tell me how to kill a java process through PID in shell script?
Thanks
Jim