vendor/bundle/ruby/1.8/gems/emissary-1.3.18/lib/emissary/daemon.rb
def kill( signal = 'INT' )
      signal = Signal.list.invert[signal] if signal.is_a?(Integer)
      pid = retrieve_pid
      logger.info "Killing PID #{pid} with #{signal}"
      Process.kill(signal, pid)
      self
    rescue Errno::EINVAL
      logger.error "Failed to kill PID #{pid} with #{signal}: " \
                   "'#{signal}' is an invalid or unsupported signal number."
    rescue Errno::EPERM
      logger.error "Failed to kill PID #{pid} with #{signal}: " \
                   "Insufficient permissions."
    rescue Errno::ESRCH
      logger.error "Failed to kill PID #{pid} with #{signal}: " \
                   "Process is deceased or zombie."
    rescue Errno::EACCES => err
      logger.error err.message
    rescue Errno::ENOENT => err
      logger.error "Could not find a PID file at #{pid_file.inspect}. " \
                   "Most likely the process is no longer running."
    rescue Exception => err
      unless err.is_a?(SystemExit)
        logger.error "Failed to kill PID #{pid} with #{signal}: #{err.message}"
      end
    end
# Send a signal to the daemon process identified by the PID file. The
# default signal to send is 'INT' (2). The signal can be given either as a
# string or a signal number.
#
# @param [String, Integer] signal The kill signal to send to the daemon
# process
# @return [Daemon] self
#
Send a signal to the daemon process identified by the PID file. The
default signal to send is 'INT' (2). The signal can be given either as a
string or a signal number.
Send a signal to the daemon process identified by the PID file . The default signal to send is ' INT ' ( 2 ) . The signal can be given either as a string or a signal number .
def kill( signal = 'INT' )
      signal = Signal.list.invert[signal] if signal.is_a?(Integer)
      pid = retrieve_pid
      logger.info "Killing PID #{pid} with #{signal}"
      Process.kill(signal, pid)
      self
    rescue Errno::EINVAL
      logger.error "Failed to kill PID #{pid} with #{signal}: " \
                   "'#{signal}' is an invalid or unsupported signal number."
    rescue Errno::EPERM
      logger.error "Failed to kill PID #{pid} with #{signal}: " \
                   "Insufficient permissions."
    rescue Errno::ESRCH
      logger.error "Failed to kill PID #{pid} with #{signal}: " \
                   "Process is deceased or zombie."
    rescue Errno::EACCES => err
      logger.error err.message
    rescue Errno::ENOENT => err
      logger.error "Could not find a PID file at #{pid_file.inspect}. " \
                   "Most likely the process is no longer running."
    rescue Exception => err
      unless err.is_a?(SystemExit)
        logger.error "Failed to kill PID #{pid} with #{signal}: #{err.message}"
      end
    end
def kill ( signal = 'INT' ) signal = Signal . list . invert [ signal ] if signal . is_a? ( Integer ) pid = retrieve_pid logger . info "Killing PID #{pid} with #{signal}" Process . kill ( signal , pid ) self rescue Errno :: EINVAL logger . error "Failed to kill PID #{pid} with #{signal}: " "'#{signal}' is an invalid or unsupported signal number." rescue Errno :: EPERM logger . error "Failed to kill PID #{pid} with #{signal}: " "Insufficient permissions." rescue Errno :: ESRCH logger . error "Failed to kill PID #{pid} with #{signal}: " "Process is deceased or zombie." rescue Errno :: EACCES => err logger . error err . message rescue Errno :: ENOENT => err logger . error "Could not find a PID file at #{pid_file.inspect}. " "Most likely the process is no longer running." rescue Exception => err unless err . is_a? ( SystemExit ) logger . error "Failed to kill PID #{pid} with #{signal}: #{err.message}" end end
Send a signal to the daemon process identified by the PID file.
Send a signal to the daemon process identified by the PID file .
None
Daemon
signal
signal The kill signal to send to the daemon process
signal The kill signal to send to the daemon process