lib/dorsal/privates.rb in dorsal-1.2 vs lib/dorsal/privates.rb in dorsal-1.3

- old
+ new

@@ -59,13 +59,13 @@ options = Methodic::get_options(_options) options.specify_presences_of :description, :pid_file options.validate return yield if options[:debug] pid = fork do - trap("SIGINT"){ exit! 0 } - trap("SIGTERM"){ exit! 0 } - trap("SIGHUP"){ exit! 0 } + trap("SIGINT"){ eit! 0 } + trap("SIGTERM"){ eit! 0 } + trap("SIGHUP"){ eit! 0 } Process.daemon $0 = options[:description] yield end File.open(options[:pid_file],"w"){|f| f.puts pid } if options[:pid_file] @@ -141,10 +141,10 @@ def stop(_options = {}) options = Methodic::get_options(_options) options.specify_presences_of :description, :pid_file options.validate File::unlink(options[:pid_file]) if File::exist?(options[:pid_file]) - pid = `COLUMNS=160 ps aux|grep ruby|grep -v grep |grep '#{options[:description]}'|awk '{ print $2}'` + pid = `COLUMNS=160 ps aux|grep -v grep |grep '#{options[:description]}'|awk '{ print $2}'` if pid.empty? then return false else if options[:name] == 'ringserver' then raise Dorsal::ServerError::new('Stopping failed') unless system("kill -TERM #{pid} > /dev/null")