File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,25 @@ import (
2121 "os"
2222)
2323
24+ const (
25+ // SdNotifyReady tells the service manager that service startup is finished
26+ // or the service finished loading its configuration.
27+ SdNotifyReady = "READY=1"
28+
29+ // SdNotifyStopping tells the service manager that the service is beginning
30+ // its shutdown.
31+ SdNotifyStopping = "STOPPING=1"
32+
33+ // SdNotifyReloading tells the service manager that this service is
34+ // reloading its configuration. Note that you must call SdNotifyReady when
35+ // it completed reloading.
36+ SdNotifyReloading = "RELOADING=1"
37+
38+ // SdNotifyWatchdog tells the service manager to update the watchdog
39+ // timestamp for the service.
40+ SdNotifyWatchdog = "WATCHDOG=1"
41+ )
42+
2443// SdNotify sends a message to the init daemon. It is common to ignore the error.
2544// If `unsetEnvironment` is true, the environment variable `NOTIFY_SOCKET`
2645// will be unconditionally unset.
Original file line number Diff line number Diff line change @@ -21,10 +21,11 @@ import (
2121 "time"
2222)
2323
24- // SdWatchdogEnabled return watchdog information for a service.
25- // Process should send daemon.SdNotify("WATCHDOG=1") every time / 2.
26- // If `unsetEnvironment` is true, the environment variables `WATCHDOG_USEC`
27- // and `WATCHDOG_PID` will be unconditionally unset.
24+ // SdWatchdogEnabled returns watchdog information for a service.
25+ // Processes should call daemon.SdNotify(false, daemon.SdNotifyWatchdog) every
26+ // time / 2.
27+ // If `unsetEnvironment` is true, the environment variables `WATCHDOG_USEC` and
28+ // `WATCHDOG_PID` will be unconditionally unset.
2829//
2930// It returns one of the following:
3031// (0, nil) - watchdog isn't enabled or we aren't the watched PID.
You can’t perform that action at this time.
0 commit comments