etcdmain: log "SdNotify" error/success
I am seeing some silent failures around systemd service. This will help find out bugs in "go-systemd" Signed-off-by: Gyuho Lee <leegyuho@amazon.com>release-3.5
parent
0eee733220
commit
2329acf05b
|
@ -47,10 +47,14 @@ func Main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func notifySystemd(lg *zap.Logger) {
|
func notifySystemd(lg *zap.Logger) {
|
||||||
|
if lg == nil {
|
||||||
|
lg = zap.NewExample()
|
||||||
|
}
|
||||||
|
lg.Info("notifying init daemon")
|
||||||
_, err := daemon.SdNotify(false, daemon.SdNotifyReady)
|
_, err := daemon.SdNotify(false, daemon.SdNotifyReady)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if lg != nil {
|
|
||||||
lg.Error("failed to notify systemd for readiness", zap.Error(err))
|
lg.Error("failed to notify systemd for readiness", zap.Error(err))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
lg.Info("successfully notified init daemon")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue