lib/puma/plugin/systemd.rb
def start(launcher)
    @launcher = launcher

    # Log relevant ENV in debug
    @launcher.events.debug "systemd: NOTIFY_SOCKET=#{ENV["NOTIFY_SOCKET"].inspect}"
    @launcher.events.debug "systemd: WATCHDOG_PID=#{ENV["WATCHDOG_PID"].inspect}"
    @launcher.events.debug "systemd: WATCHDOG_USEC=#{ENV["WATCHDOG_USEC"].inspect}"

    # Only install hooks if systemd is present, the systemd is booted by
    # systemd, and systemd has asked us to notify it of events.
    @systemd = Systemd.new
    if @systemd.present? && @systemd.booted? && @systemd.notify?
      @launcher.events.debug "systemd: detected running inside systemd, registering hooks"
      register_hooks
    else
      @launcher.events.debug "systemd: not running within systemd, doing nothing"
    end
  end
# We can start doing something when we have a launcher:
We can start doing something when we have a launcher.
We can start doing something when we have a launcher .
def start(launcher)
    @launcher = launcher
    @launcher.events.debug "systemd: NOTIFY_SOCKET=#{ENV["NOTIFY_SOCKET"].inspect}"
    @launcher.events.debug "systemd: WATCHDOG_PID=#{ENV["WATCHDOG_PID"].inspect}"
    @launcher.events.debug "systemd: WATCHDOG_USEC=#{ENV["WATCHDOG_USEC"].inspect}"
    @systemd = Systemd.new
    if @systemd.present? && @systemd.booted? && @systemd.notify?
      @launcher.events.debug "systemd: detected running inside systemd, registering hooks"
      register_hooks
    else
      @launcher.events.debug "systemd: not running within systemd, doing nothing"
    end
  end
def start ( launcher ) @launcher = launcher @launcher . events . debug "systemd: NOTIFY_SOCKET=#{ENV["NOTIFY_SOCKET"].inspect}" @launcher . events . debug "systemd: WATCHDOG_PID=#{ENV["WATCHDOG_PID"].inspect}" @launcher . events . debug "systemd: WATCHDOG_USEC=#{ENV["WATCHDOG_USEC"].inspect}" @systemd = Systemd . new if @systemd . present? && @systemd . booted? && @systemd . notify? @launcher . events . debug "systemd: detected running inside systemd, registering hooks" register_hooks else @launcher . events . debug "systemd: not running within systemd, doing nothing" end end
We can start doing something when we have a launcher:
We can start doing something when we have a launcher :
# Log relevant ENV in debug # Only install hooks if systemd is present, the systemd is booted by # systemd, and systemd has asked us to notify it of events.
launcher