Operating System - HP-UX
1837035 Members
3080 Online
110111 Solutions
New Discussion

Re: tracking pid of applications

 

tracking pid of applications

hi i'm running 3 java application and i want to capture the 2 java application particularly in a variable and if i kill that varible that particular application should have a normal stop with causing any distruption to other application. the entire things should be done in a solaris shell scripts....

kamalesh
2 REPLIES 2
Michael Steele_2
Honored Contributor

Re: tracking pid of applications

Variables are too volitile so store your PID in a file. There are several examples of this in UNIX. In Solaris the whole /proc file system.

Also put some tight permissions on the file, like 600, and store it in a working directory hard coded in the script.
Support Fatherhood - Stop Family Law
A. Clay Stephenson
Acclaimed Contributor

Re: tracking pid of applications

This is a far from trivial task. Sending a signal to a process is easy but how that process responds to that signal is entirely up to that application -- it might be coded to ignore the signal, for example. Moreover, killing one process in a group of interdependent processes can certainly have unexpected consequences. Your problem is going to have to be much better defined before you simply start sending kill -s 15's (or whatever) to a bunch of processes.
If it ain't broke, I can fix that.