Skip to content

Commit

Permalink
Do not crash if PID file is deleted while trying to read it
Browse files Browse the repository at this point in the history
  • Loading branch information
FooBarWidget committed Oct 10, 2017
1 parent 8b1d35e commit 00c3eb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/daemon_controller.rb
Expand Up @@ -482,7 +482,11 @@ def daemon_is_running?
end

def read_pid_file
pid = File.read(@pid_file).strip
begin
pid = File.read(@pid_file).strip
rescue Errno::ENOENT
return nil
end
if pid =~ /\A\d+\Z/
pid.to_i
else
Expand Down

0 comments on commit 00c3eb5

Please sign in to comment.