lib/puma/plugin/systemd.rb
# Give us a way to talk to systemd.
#
# It'd be great to use systemd-notify for the whole shebang, but there's a
# critical error introducing a race condition:
#
#   https://github.com/systemd/systemd/issues/2739
#
# systemd-notify docs:
#
#   https://www.freedesktop.org/software/systemd/man/systemd-notify.html
#
# We could use sd-daemon (sd_notify and friends) but they require a C
# extension, and are really just fancy wrappers for blatting datagrams at a
# socket advertised via ENV. See the docs:
#
#   https://www.freedesktop.org/software/systemd/man/sd-daemon.html
#
Give us a way to talk to systemd.
It'd be great to use systemd-notify for the whole shebang, but there's a
critical error introducing a race condition.



systemd-notify docs.



We could use sd-daemon (sd_notify and friends) but they require a C
extension, and are really just fancy wrappers for blatting datagrams at a
socket advertised via ENV. See the docs.


Give us a way to talk to systemd . It ' d be great to use systemd - notify for the whole shebang but there ' s a critical error introducing a race condition . systemd - notify docs . We could use sd - daemon ( sd_notify and friends ) but they require a C extension and are really just fancy wrappers for blatting datagrams at a socket advertised via ENV . See the docs .
def booted
    @launcher.events.log "* systemd: notify ready"
    begin
      @systemd.notify_ready
    rescue
      @launcher.events.error "! systemd: notify ready failed:\n  #{$!.to_s}\n  #{$!.backtrace.join("\n    ")}"
    end
  end
def booted @launcher . events . log "* systemd: notify ready" begin @systemd . notify_ready rescue @launcher . events . error "! systemd: notify ready failed:\n  #{$!.to_s}\n  #{$!.backtrace.join("\n    ")}" end end
Give us a way to talk to systemd.
Give us a way to talk to systemd .