rpcbind/0014-Notify-systemd-unconditionally.patch

41 lines
1.2 KiB
Diff

From 95d8dc18699638313a2b9bd3dcd3b84eaed432d8 Mon Sep 17 00:00:00 2001
From: Olaf Kirch <okir@suse.de>
Date: Fri, 10 Jan 2014 11:29:40 +0100
Subject: [PATCH 14/14] 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 <okir@suse.de>
---
src/rpcbind.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/rpcbind.c b/src/rpcbind.c
index 7fa6baf..8df2950 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