search for: pid_handl

Displaying 2 results from an estimated 2 matches for "pid_handl".

Did you mean: pid_handle
2008 Nov 20
1
Stopping bdrb from another process gets the process killed
...y 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) File.delete(arg_pid_file) if File.exists?(arg_pid_file) puts "Success!" end What I did was, tha...
2008 Jan 03
5
Start script not working when run via Rake
...en executing ''backgroundrb stop'' in a rake task. As a workaround I have modified by ''backgroundrb'' script as follows: when ''stop'' path = "#{RAILS_HOME}/log/backgroundrb.pid" pid = nil begin File.open(path, "r") { |pid_handle| pid = pid_handle.gets.strip.chomp.to_i } pgid = Process.getpgid(pid) Process.kill(''TERM'', pid) Process.kill(''-TERM'', pgid) Process.kill(''KILL'', pid) rescue puts $! ensure puts "Deleting pid file" File...