tree-wide: warn when sd_notify fails with READY=1 or FDSTOREREMOVE=1
Most sd_notify() calls are like log_info() — the result is only informative and if they fail, it's best ignore this. But if a call with READY=1 fails, the unit may enter a failed state, so we should warn about this. Similarly for FSTOREREMOVE=1: the manager may be left with a stale fd, at least wasting resources.
This commit is contained in:
+4
-1
@@ -317,7 +317,10 @@ static int run(int argc, char *argv[]) {
|
||||
if (!ready) {
|
||||
/* Notify manager that we are now finished with processing whatever was
|
||||
* queued */
|
||||
(void) sd_notify(false, "READY=1");
|
||||
r = sd_notify(false, "READY=1");
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to send readiness notification, ignoring: %m");
|
||||
|
||||
ready = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user