Revert "daemon/command: add support for sd_notify "reload" notifications"
This reverts commit af18206630.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
4 files changed
-34
No files matched your search
@@ -531,13 +531,6 @@ func (cli *daemonCLI) reloadConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
// On Linux, we use sd_notify to indicate we're reloading config. We send
|
||||
// this signal as early as possible to let systemd know we're reloading,
|
||||
// but must signal "ready" after this completes (even on failure), which
|
||||
// is done by the reload function defined above.
|
||||
done := notifyReloading()
|
||||
defer done()
|
||||
|
||||
if err := config.Reload(*cli.configFile, cli.flags, reload); err != nil {
|
||||
log.G(ctx).WithError(err).Error("Error reloading configuration")
|
||||
return
|
||||
|
||||
@@ -11,10 +11,6 @@ func preNotifyReady() error {
|
||||
func notifyReady() {
|
||||
}
|
||||
|
||||
// notifyReloading sends a message to the host when the server got signaled to
|
||||
// reloading its configuration. It is a no-op on FreeBSD.
|
||||
func notifyReloading() func() { return func() {} }
|
||||
|
||||
// notifyStopping sends a message to the host when the server is shutting down
|
||||
func notifyStopping() {
|
||||
}
|
||||
|
||||
@@ -58,25 +58,6 @@ func notifyStopping() {
|
||||
_, _ = systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyStopping)
|
||||
}
|
||||
|
||||
// notifyReloading sends a message to the host when the server got signaled to
|
||||
// reloading its configuration, see [sd_notify(3)]. The server should be running
|
||||
// as a systemd unit with "Type=notify" or "Type=notify-reload" (see
|
||||
// [systemd.service(5)]).
|
||||
//
|
||||
// notifyReloading returns a callback that must be called after reloading completes
|
||||
// (either successfully or unsuccessfully) to send [notifyReady].
|
||||
//
|
||||
// [sd_notify(3)]: https://www.freedesktop.org/software/systemd/man/latest/sd_notify.html#RELOADING=1
|
||||
// [systemd.service(5)]: https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Type=
|
||||
func notifyReloading() (done func()) {
|
||||
sent, _ := systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyReloading+"\n"+systemdDaemon.SdNotifyMonotonicUsec())
|
||||
if !sent {
|
||||
// Nothing to do if no reloading event was sent.
|
||||
return func() {}
|
||||
}
|
||||
return notifyReady
|
||||
}
|
||||
|
||||
func validateCPURealtimeOptions(cfg *config.Config) error {
|
||||
if cfg.CPURealtimePeriod == 0 && cfg.CPURealtimeRuntime == 0 {
|
||||
return nil
|
||||
|
||||
@@ -56,10 +56,6 @@ func preNotifyReady() error {
|
||||
func notifyReady() {
|
||||
}
|
||||
|
||||
// notifyReloading sends a message to the host when the server got signaled to
|
||||
// reloading its configuration. It is a no-op on Windows.
|
||||
func notifyReloading() func() { return func() {} }
|
||||
|
||||
// notifyStopping sends a message to the host when the server is shutting down
|
||||
func notifyStopping() {
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user