I want to control many different Sinatra applications from a central application (Sinatra).
The problem I am facing, no matter how I make / start / start the call, to start it, I can not get the pid of the Sinatra server so that I can kill (: int) it?
This is due to my shell exec line, which contains several other commands, so I get the pid from the first. My command line is like
command = source ~/.profile; rbenv
So, I get the pid of the sh process of the sourcing command.
The question is, how can I get the pid of the ruby command running above?
I am currently using spawn, but I have tried most others, but I don’t think this is a problem!
pid = Process.spawn(command) pid
Beginning of the ruby application itself
$ ps aux 1234 sh -c . ~/.profile; shell_script 4567 shell_script
I want to know 4567 !?
source share