rpcbind/0016-Notify-systemd-unconditionally.patch
Dirk Mueller 868d58656c Accepting request 215477 from home:okir:branches:network
- Fixed rpc broadcast handling (bnc#857324)
  Upgraded to upstream 0.2.1-rc4 as part of this, and rebased the
  patch set.

OBS-URL: https://build.opensuse.org/request/show/215477
OBS-URL: https://build.opensuse.org/package/show/network/rpcbind?expand=0&rev=32
2014-01-30 14:01:34 +00:00

41 lines
1.2 KiB
Diff

From 114b974116d44201a4dba6b7e9311f0ffb318ee3 Mon Sep 17 00:00:00 2001
From: Olaf Kirch <okir@suse.de>
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 <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 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