# File lib/picnic/service_control.rb, line 249 def get_state if File.exists? @options[:pid_file] pid = File.read(@options[:pid_file]).strip return :empty_pid unless pid and !pid.empty? # pid file exists but is empty state = `ps -p #{pid} -o state=`.strip if state == '' return :not_running elsif state == 'R' || state == 'S' return :ok else return :dead end else # TODO: scan through the process table to see if server is running without pid file return :missing_pid end end