Changeset 236
- Timestamp:
- 12/09/07 10:30:40 (9 months ago)
- Files:
-
- trunk/script/backgroundrb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/script/backgroundrb
r229 r236 27 27 when 'stop' 28 28 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" 32 38 end 33 39 File.delete(path)
