Blame SOURCES/0042-handle-systemd-shutdown.patch

0240e4
From 6aae8542abedc755b90c8c49aa5c429718fd12f1 Mon Sep 17 00:00:00 2001
0240e4
From: Klaus Wenninger <klaus.wenninger@aon.at>
0240e4
Date: Tue, 12 Jan 2016 15:46:26 +0100
0240e4
Subject: [PATCH] Fix RHBZ#1286316: Do an ordered shutdown of systemd resources
0240e4
     have lrmd wait till systemd actually starts bringing down systemd
0240e4
 resources     instead of being confused if service is still active on first
0240e4
 status     send a reload to systemd whenever a unitfile is changed instead of
0240e4
 doing     this just with every 10th change
0240e4
0240e4
---
0240e4
 lib/services/systemd.c | 11 ++++-------
0240e4
 lrmd/lrmd.c            |  2 ++
0240e4
 2 files changed, 6 insertions(+), 7 deletions(-)
0240e4
0240e4
diff --git a/lib/services/systemd.c b/lib/services/systemd.c
0240e4
index a851bc6..eb5f8aa 100644
0240e4
--- a/lib/services/systemd.c
0240e4
+++ b/lib/services/systemd.c
0240e4
@@ -150,16 +150,13 @@ systemd_daemon_reload(int timeout)
0240e4
 {
0240e4
     static unsigned int reload_count = 0;
0240e4
     const char *method = "Reload";
0240e4
-
0240e4
+    DBusMessage *msg = systemd_new_method(BUS_NAME".Manager", method);
0240e4
 
0240e4
     reload_count++;
0240e4
-    if(reload_count % 10 == 0) {
0240e4
-        DBusMessage *msg = systemd_new_method(BUS_NAME".Manager", method);
0240e4
+    CRM_ASSERT(msg != NULL);
0240e4
+    pcmk_dbus_send(msg, systemd_proxy, systemd_daemon_reload_complete, GUINT_TO_POINTER(reload_count), timeout);
0240e4
+    dbus_message_unref(msg);
0240e4
 
0240e4
-        CRM_ASSERT(msg != NULL);
0240e4
-        pcmk_dbus_send(msg, systemd_proxy, systemd_daemon_reload_complete, GUINT_TO_POINTER(reload_count), timeout);
0240e4
-        dbus_message_unref(msg);
0240e4
-    }
0240e4
     return TRUE;
0240e4
 }
0240e4
 
0240e4
diff --git a/lrmd/lrmd.c b/lrmd/lrmd.c
0240e4
index a64b430..518d5d1 100644
0240e4
--- a/lrmd/lrmd.c
0240e4
+++ b/lrmd/lrmd.c
0240e4
@@ -900,6 +900,8 @@ action_complete(svc_action_t * action)
0240e4
             /* Ok, so this is the follow up monitor action to check if start actually completed */
0240e4
             if(cmd->lrmd_op_status == PCMK_LRM_OP_DONE && cmd->exec_rc == PCMK_OCF_PENDING) {
0240e4
                 goagain = true;
0240e4
+            } else if(cmd->exec_rc == PCMK_OCF_OK && safe_str_eq(cmd->real_action, "stop")) {
0240e4
+                goagain = true;
0240e4
 
0240e4
             } else {
0240e4
 #ifdef HAVE_SYS_TIMEB_H
0240e4
-- 
0240e4
1.8.3.1
0240e4