Created
June 13, 2009 18:39
-
-
Save dyoder/129372 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Stop agents from running background tasks" | |
task :stop do | |
if File.exist?( pidfile ) | |
pid = File.read( pidfile ).to_i | |
if pid > 0 | |
puts "Stopping agents (process #{pid})." | |
Process.kill('INT', pid.to_i ) rescue nil | |
end | |
`rm #{pidfile}` | |
else | |
puts "No agents are currently running." | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment