How would I run '/usr/bin/java -jar "/path/to/jenkins.war" &' with OSProcess?
Specifically I want to know the process number of the java child process.

I unsuccessfully tried:
* PipeableOSProcess command: '/usr/bin/java -jar "/path/to/jenkins.war" &',
which successfully launches java, but I don't know its pid because the
returned process is the completed parent "sh" that launched it
* PipeableOSProcess command: '/usr/bin/java -jar "/path/to/jenkins.war"'
(without ampersand), which also launches successfully, and leaves the parent
"sh" process running as well (not as clean), but I still don't know the java
pid

I then succeeded with:
  p := PipeableOSProcess command: '/usr/bin/java -jar "/path/to/jenkins.war"
& { echo $! ; }'.
  p output lines first.

But this seems convoluted and I'm assuming there must be a simpler way.

What is the best way to do this?
I.e.:
* launch a long running child process
* without keeping the sh process open
* accessing the pid of the child

Thanks,
Sean

--
View this message in context: 
http://forum.world.st/Running-in-background-with-OSProcess-tp4615534.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

Reply via email to