b05147c356
Change patch format to remove Git version * Patches 0001-0122 only have the patch format modified Update to the head of the upstream staging branch plus redhat patches * Patches 0123-0134 & 1036-0142 are from the upstream staging branch * Patches 0143-1046 have been submitted upstream * Patch 0156 is a Red Hat only patch. Red Hat udev rules set ID_SERIAL from 60-persistent-storage.rules instead of 55-scsi-sg3_id.rules. Multipath's parse_vpd_pg83() function needs to match the ID_SERIAL value from udev. Rename files * Previous patches 0123-0132 are now patches 1035 & 0147-0155
65 lines
1.8 KiB
Diff
65 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Martin Wilck <mwilck@suse.com>
|
|
Date: Tue, 15 Sep 2020 10:23:05 +0200
|
|
Subject: [PATCH] multipathd: avoid sending "READY=1" to systemd on early
|
|
shutdown
|
|
|
|
If multipathd gets a shutdown request during initial reconfigure(),
|
|
it shouldn't send "READY=1" to systemd. Ensure this by sending
|
|
"READY=1" via post_config_state().
|
|
|
|
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
---
|
|
multipathd/main.c | 16 +++++++---------
|
|
1 file changed, 7 insertions(+), 9 deletions(-)
|
|
|
|
diff --git a/multipathd/main.c b/multipathd/main.c
|
|
index fa53e963..53a22a43 100644
|
|
--- a/multipathd/main.c
|
|
+++ b/multipathd/main.c
|
|
@@ -189,6 +189,8 @@ static void do_sd_notify(enum daemon_status old_state,
|
|
{
|
|
char notify_msg[MSG_SIZE];
|
|
const char *msg;
|
|
+ static bool startup_done = false;
|
|
+
|
|
/*
|
|
* Checkerloop switches back and forth between idle and running state.
|
|
* No need to tell systemd each time.
|
|
@@ -205,6 +207,11 @@ static void do_sd_notify(enum daemon_status old_state,
|
|
|
|
if (msg && !safe_sprintf(notify_msg, "STATUS=%s", msg))
|
|
sd_notify(0, notify_msg);
|
|
+
|
|
+ if (new_state == DAEMON_IDLE && !startup_done) {
|
|
+ sd_notify(0, "READY=1");
|
|
+ startup_done = true;
|
|
+ }
|
|
}
|
|
#endif
|
|
|
|
@@ -2903,9 +2910,6 @@ child (__attribute__((unused)) void *param)
|
|
struct vectors * vecs;
|
|
struct multipath * mpp;
|
|
int i;
|
|
-#ifdef USE_SYSTEMD
|
|
- int startup_done = 0;
|
|
-#endif
|
|
int rc;
|
|
int pid_fd = -1;
|
|
struct config *conf;
|
|
@@ -3065,12 +3069,6 @@ child (__attribute__((unused)) 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
|
|
}
|
|
}
|
|
|