finding java process id using perl on Linux
Posted on 2007-11-18
Whats the best way to find a java process for a particular user so that a system call for sighup can be issued? Basically I need to find the PID for several reasons - but the main one is it kill the jvm process from a tomcat installation. (There are more than one jvm running and by having the user information I should be able to pull their active JAVA PID)
ps -u username | grep java works for bash.
In perl i tried:
system "ps -u username | grep java > tempPID.txt";
then i was going to access the file and pull the PID but I couldn't get the system call to work.