Method: Controller#stop
- Defined in:
- bin/magent
#stop ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'bin/magent', line 98 def stop begin pid = File.read(pid_file).to_i Process.kill("TERM", pid) Process.kill(0, pid) Process.wait rescue Errno::ECHILD, Errno::ESRCH => e $stdout.puts "Process #{pid} has stopped" rescue Errno::ENOENT => e $stdout.puts "Warning: #{e}" ensure File.unlink(pid_file) if File.exist?(pid_file) end end |