Skip to content

Instantly share code, notes, and snippets.

require 'daemons'
module Daemons
class Monitor
def stop
pid = @pid.pid
begin; Process.kill('TERM', pid); rescue ::Exception; end
sleep(0.5)
begin; Process.kill('KILL', pid); rescue ::Exception; end