Method: Exekutor::Internal::CLI::Daemon#pid

Defined in:
lib/exekutor/internal/cli/daemon.rb

#pidInteger?

The process ID for this daemon, if known

Returns:

  • (Integer, nil)

    The process ID

Raises:

  • (Error)

    if the pid-file is corrupt



30
31
32
33
34
35
36
37
# File 'lib/exekutor/internal/cli/daemon.rb', line 30

def pid
  return nil unless ::File.exist? pidfile

  pid = ::File.read(pidfile)
  raise Error, "Corrupt PID-file. Check #{pidfile}" unless pid.to_i.positive?

  pid.to_i
end