[dm-devel] [PATCH 11/33] multipathd: issue systemd READY after initial configuration
Martin Wilck
mwilck at suse.com
Tue Feb 28 16:23:07 UTC 2017
From: Hannes Reinecke <hare at suse.de>
We should be issueing systemd READY only after the initial
configuration has been completed, otherwise systemd might
continue while the multipath devices are not setup up properly.
Signed-off-by: Hannes Reinecke <hare at suse.com>
---
multipathd/main.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/multipathd/main.c b/multipathd/main.c
index 86d73f7b..cf44778b 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -2361,6 +2361,7 @@ child (void * param)
int i;
#ifdef USE_SYSTEMD
unsigned long checkint;
+ int startup_done = 0;
#endif
int rc;
int pid_fd = -1;
@@ -2509,10 +2510,6 @@ child (void * param)
}
pthread_attr_destroy(&misc_attr);
-#ifdef USE_SYSTEMD
- sd_notify(0, "READY=1");
-#endif
-
while (running_state != DAEMON_SHUTDOWN) {
pthread_cleanup_push(config_cleanup, NULL);
pthread_mutex_lock(&config_lock);
@@ -2534,6 +2531,12 @@ child (void * param)
}
lock_cleanup_pop(vecs->lock);
post_config_state(DAEMON_IDLE);
+#ifdef USE_SYSTEMD
+ if (!startup_done) {
+ sd_notify(0, "READY=1");
+ startup_done = 1;
+ }
+#endif
}
}
--
2.11.0
More information about the dm-devel
mailing list