Bluepill is not stopping child processes on restart / stop event (bug?)

98 vues
Accéder directement au premier message non lu

Szymon Jeż

non lue,
5 janv. 2012, 04:40:2005/01/2012
à 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.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message