# File lib/daemons/application.rb, line 319 def stop if options[:force] and not running? self.zap return end # Catch errors when trying to kill a process that doesn't # exist. This happens when the process quits and hasn't been # restarted by the monitor yet. By catching the error, we allow the # pid file clean-up to occur. begin Process.kill(SIGNAL, @pid.pid) rescue Errno::ESRCH => e puts "#{e} #{@pid.pid}" puts "deleting pid-file." end # We try to remove the pid-files by ourselves, in case the application # didn't clean it up. begin; @pid.cleanup; rescue ::Exception; end end