Skip to content

Commit

Permalink
Do not fail stop command if pidfile is stale or missing
Browse files Browse the repository at this point in the history
  • Loading branch information
kovyrin committed Jan 31, 2014
1 parent f6e5720 commit 396befa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/loops/commands/stop_command.rb
@@ -1,7 +1,12 @@
class Loops::Commands::StopCommand < Loops::Command
def execute
STDOUT.sync = true
raise "No pid file or a stale pid file!" unless Loops::Daemonize.check_pid(Loops.pid_file)

unless Loops::Daemonize.check_pid(Loops.pid_file)
print "WARNING: No pid file or a stale pid file found! Exiting."
exit(0)
end

pid = Loops::Daemonize.read_pid(Loops.pid_file)
print "Killing the process: #{pid}: "

Expand All @@ -19,4 +24,4 @@ def execute
def requires_bootstrap?
false
end
end
end

0 comments on commit 396befa

Please sign in to comment.