daemon_linux.go 588 B

123456789101112131415161718
  1. package main
  2. import systemdDaemon "github.com/coreos/go-systemd/v22/daemon"
  3. // preNotifyReady sends a message to the host when the API is active, but before the daemon is
  4. func preNotifyReady() {
  5. }
  6. // notifyReady sends a message to the host when the server is ready to be used
  7. func notifyReady() {
  8. // Tell the init daemon we are accepting requests
  9. go systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyReady)
  10. }
  11. // notifyStopping sends a message to the host when the server is shutting down
  12. func notifyStopping() {
  13. go systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyStopping)
  14. }