Bluepill is not stopping child processes on restart / stop event (bug?)
99 views
Skip to first unread message
Szymon Jeż
unread,
Jan 5, 2012, 4:40:20 AM1/5/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Bluepill
Hi,
I manage with Bluepill a process that spawns a child process. AFAIK
Bluepill is not doing anything with the child process when I send a
stop/restart event to the parent process that is managed via Bluepill
(bluepill some_app stop some_process). Therefore I had to use `pkill'
to handle the killing of the main process (killing the child makes the
parent in this case also end). Is this a design decision? I was
surprised that stopping an process lives me with a bunch of spawned
children that can live even when the parent was killed.
My current config:
<pre>
app.process("some_process") do |process|
# this kills all the child processes
process.stop_command = "pkill -QUIT -P {{PID}}"
# this gets never called during stop/restart
process.monitor_children do |child_process|
child_process.stop_command = "kill -QUIT {{PID}}"
end
# + some more unrelated configuration
end
</pre>
Should not there be:
@children.each do |child_process| child_process.restart_process end if
@children
at the end of the Bluepill::Process#stop_process and
Bluepill::Process#restart_process methods?
This code AFAIR worked for me in Bluepill version 0.0.51.