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