Changeset 236

Show
Ignore:
Timestamp:
12/09/07 10:30:40 (9 months ago)
Author:
gethema..@gmail.com
Message:

check in new script

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/script/backgroundrb

    r229 r236  
    2727when 'stop' 
    2828  path = "#{RAILS_HOME}/log/backgroundrb.pid" 
    29   File.open(path, "r") do |pid_handle| 
    30     pid = pid_handle.gets.strip.chomp 
    31     Process.kill(15,pid.to_i) 
     29  pid = nil 
     30  File.open(path, "r") { |pid_handle| pid = pid_handle.gets.strip.chomp.to_i } 
     31  begin 
     32    pgid =  Process.getpgid(pid) 
     33    Process.kill('TERM', pid) 
     34    Process.kill('-TERM', pgid) 
     35    Process.kill('KILL', pid) 
     36  rescue Errno::ESRCH => e 
     37    puts "Deleting pid file" 
    3238  end 
    3339  File.delete(path)