Method: Exekutor::Internal::CLI::Daemon#status
- Defined in:
- lib/exekutor/internal/cli/daemon.rb
#status ⇒ :running, ...
The process status for this daemon. Possible states are:
-
:runningwhen the daemon is running; -
:not_runningwhen the daemon is not running; -
:deadwhen the daemon is dead. (Ie. the PID is known, but the process is gone); -
:not_ownedwhen the daemon cannot be accessed.
45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/exekutor/internal/cli/daemon.rb', line 45 def status pid = self.pid return :not_running if pid.nil? # If sig is 0, then no signal is sent, but error checking is still performed; this can be used to check for # the existence of a process ID or process group ID. ::Process.kill(0, pid) :running rescue Errno::ESRCH :dead rescue Errno::EPERM :not_owned end |