Displaying 1 result from an estimated 1 matches for "starstop".
Did you mean:
startstop
2008 Nov 20
1
Stopping bdrb from another process gets the process killed
...illing the parent of the group of the
process. This is ok if you''re running script/backgroundrb stop directly from
the console, but if I''m running this from another process, let''s say a rake
task, the rake task gets killed because it gets the SIGTERM signal.
In the class StarStop we have:
def kill_process arg_pid_file
pid = nil
pid = File.open(arg_pid_file, "r") { |pid_handle|
pid_handle.gets.strip.chomp.to_i }
pgid = Process.getpgid(pid)
puts "Stopping BackgrounDRb with pid #{pid}...."
Process.kill(''-TERM'', pgid...