Browse files

in the case of a dead bdrb needing pidfile cleaning, now cleans all p…

…idfiles and not just main pidfile

Signed-off-by: Hemant Kumar <gethemant@gmail.com>
  • Loading branch information...
1 parent eae8d17 commit 2410826adefa135fe2e75e25c581cd03c04550dd Woody Peterson committed with Apr 14, 2009
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/backgroundrb/bdrb_start_stop.rb
View
7 lib/backgroundrb/bdrb_start_stop.rb
@@ -7,7 +7,7 @@ def start
puts "BackgrounDRb Already Running"
exit(0)
elsif dead? # dead, but pid exists
- remove_pidfile
+ remove_pidfiles
end
# status == 3, not running.
@@ -67,8 +67,9 @@ def pid
File.read(PID_FILE).strip.to_i if pidfile_exists?
end
- def remove_pidfile
- File.delete(PID_FILE)
+ def remove_pidfiles
+ require 'fileutils'
+ FileUtils.rm_rf("#{RAILS_HOME}/tmp/pids/backgroundrb_*.pid")
end
def start_bdrb

0 comments on commit 2410826

Please sign in to comment.