etcdmain: log "SdNotify" error/success
I am seeing some silent failures around systemd service.
This will help find out bugs in "go-systemd"
@@ -47,10 +47,14 @@ func Main() {
}
func notifySystemd(lg *zap.Logger) {
+ if lg == nil {
+ lg = zap.NewExample()
+ }
+ lg.Info("notifying init daemon")
_, err := daemon.SdNotify(false, daemon.SdNotifyReady)
if err != nil {
- if lg != nil {
lg.Error("failed to notify systemd for readiness", zap.Error(err))
+ return
}
- }
+ lg.Info("successfully notified init daemon")
}
