lib/dorsal/privates.rb in dorsal-1.1 vs lib/dorsal/privates.rb in dorsal-1.2
- old
+ new
@@ -118,11 +118,11 @@
def start(_options = {})
options = Methodic::get_options(_options)
options.specify_presences_of :description, :pid_file
options.validate
raise Dorsal::RingServerError::new('already running, pid file exist') if File::exist?(options[:pid_file])
- raise Dorsal::RingServerError::new('already running') unless `ps aux|grep ruby|grep -v grep |grep '#{options[:description]}'`.empty?
+ raise Dorsal::RingServerError::new('already running, process found') unless `ps aux|grep -v grep |grep '#{options[:description]}'`.empty?
return daemonize(options) do
yield
end
end
@@ -169,10 +169,10 @@
# end
def status(_options = {})
options = Methodic::get_options(_options)
options.specify_presences_of :description, :pid_file
options.validate
- 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
File.open(options[:pid_file],"w"){|f| f.puts pid } unless File::exist?(options[:pid_file])
return true