Anders, On Saturday 09 April 2005 12:01, Anders Norrbring wrote:
I need to start a java process and get a valid pid for it to be able to kill it later.
So, I thought I could use startproc in this way 'startproc -f -p /var/run/myproc.pid /usr/bin/java/ jarfil.jar'
But noway.. I don't get a pid file at all. So, how should I do to get a valid pidfile for the process?
1) Choose a directory for the PID file to which you have write access. 2) Give yourself write access to /var/run. 3) Create (as root) a writable sub-directory of /var/run. I'd probably go with (3). And I'd also use a more distinctive name than "myproc.pid". Furthermore, the syntax for invoking a so-called "executable JAR file" is "java -jar jarfile.jar". (Assuming the java launcher's directory is in your PATH. Use the full path name, say "/usr/lib/java/bin/java", if it's not.) If the JAR file does not have the necessary manifest information to be "executable," you'll have to discover the name of the class that implements the static main() method that is the entry point for the application.
Anders.
Randall Schulz