From 114b974116d44201a4dba6b7e9311f0ffb318ee3 Mon Sep 17 00:00:00 2001 From: Olaf Kirch Date: Fri, 10 Jan 2014 11:29:40 +0100 Subject: [PATCH 16/24] Notify systemd unconditionally rpcbind may be started from systemd with or without socket activation. However, in both cases systemd would expect to be notified of successful startup. If we're started from the command line, calling sd_notify doesn't do any harm either; it will just silently fail. Signed-off-by: Olaf Kirch --- src/rpcbind.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rpcbind.c b/src/rpcbind.c index 6d1f1a3..b070c32 100644 --- a/src/rpcbind.c +++ b/src/rpcbind.c @@ -260,9 +260,13 @@ main(int argc, char *argv[]) #endif network_init(); + #ifdef SYSTEMD - if (systemd_activation) - sd_notify(0, "READY=1"); + /* Try to notify system of successful startup, regardless of whether we + * used systemd socket activation or not. When started from the command + * line, this should not hurt either. + */ + rpcbind_log_error("sd_notify returns %d\n", sd_notify(0, "READY=1")); #endif my_svc_run(); rpcbind_log_error("svc_run returned unexpectedly"); -- 1.7.12.4