diff --git a/SOURCES/bz1198886-0315c57-ask-dbus-not-to-kill-on-shutdown-2.patch b/SOURCES/bz1198886-0315c57-ask-dbus-not-to-kill-on-shutdown-2.patch new file mode 100644 index 0000000..c315029 --- /dev/null +++ b/SOURCES/bz1198886-0315c57-ask-dbus-not-to-kill-on-shutdown-2.patch @@ -0,0 +1,25 @@ +From 0315c578905378726787c695d7d07188ba97f892 Mon Sep 17 00:00:00 2001 +From: Andrew Beekhof +Date: Tue, 24 Mar 2015 07:48:51 +1100 +Subject: [PATCH] Fix: systemd: Kindly ask dbus NOT to kill the process if the + dbus connection fails + +--- + lib/services/dbus.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/lib/services/dbus.c b/lib/services/dbus.c +index f44b590..0623168 100644 +--- a/lib/services/dbus.c ++++ b/lib/services/dbus.c +@@ -533,6 +533,7 @@ pcmk_dbus_timeout_toggle(DBusTimeout *timeout, void *data){ + /* Inspired by http://www.kolej.mff.cuni.cz/~vesej3am/devel/dbus-select.c */ + + void pcmk_dbus_connection_setup_with_select(DBusConnection *c){ ++ dbus_connection_set_exit_on_disconnect (c, FALSE); + dbus_connection_set_timeout_functions( + c, pcmk_dbus_timeout_add, pcmk_dbus_timeout_remove, pcmk_dbus_timeout_toggle, NULL, NULL); + dbus_connection_set_watch_functions(c, pcmk_dbus_watch_add, pcmk_dbus_watch_remove, pcmk_dbus_watch_toggle, NULL, NULL); +-- +1.8.4.2 + diff --git a/SOURCES/bz1198886-2ab97ec-systemd-stop-1.patch b/SOURCES/bz1198886-2ab97ec-systemd-stop-1.patch new file mode 100644 index 0000000..2159a43 --- /dev/null +++ b/SOURCES/bz1198886-2ab97ec-systemd-stop-1.patch @@ -0,0 +1,44 @@ +diff --git a/lib/services/systemd.c b/lib/services/systemd.c +index 10c605a..c797c47 100644 +--- a/lib/services/systemd.c ++++ b/lib/services/systemd.c +@@ -545,15 +545,27 @@ systemd_unit_exec_with_unit(svc_action_t * op, const char *unit) + + } else if (g_strcmp0(method, "start") == 0) { + FILE *file_strm = NULL; +- char *override_dir = g_strdup_printf("%s/%s", SYSTEMD_OVERRIDE_ROOT, unit); +- char *override_file = g_strdup_printf("%s/%s/50-pacemaker.conf", SYSTEMD_OVERRIDE_ROOT, unit); ++ char *override_dir = g_strdup_printf("%s/%s.service.d", SYSTEMD_OVERRIDE_ROOT, op->agent); ++ char *override_file = g_strdup_printf("%s/%s.service.d/50-pacemaker.conf", SYSTEMD_OVERRIDE_ROOT, op->agent); + + method = "StartUnit"; + crm_build_path(override_dir, 0755); + + file_strm = fopen(override_file, "w"); + if (file_strm != NULL) { +- int rc = fprintf(file_strm, "[Service]\nRestart=no"); ++ /* TODO: Insert the start timeout in too */ ++ char *override = g_strdup_printf( ++ "[Unit]\n" ++ "Description=Cluster Controlled %s\n" ++ "Before=pacemaker.service\n" ++ "\n" ++ "[Service]\n" ++ "Restart=no\n", ++ op->agent); ++ ++ int rc = fprintf(file_strm, "%s\n", override); ++ ++ free(override); + if (rc < 0) { + crm_perror(LOG_ERR, "Cannot write to systemd override file %s", override_file); + } +@@ -571,7 +583,7 @@ systemd_unit_exec_with_unit(svc_action_t * op, const char *unit) + free(override_dir); + + } else if (g_strcmp0(method, "stop") == 0) { +- char *override_file = g_strdup_printf("%s/%s/50-pacemaker.conf", SYSTEMD_OVERRIDE_ROOT, unit); ++ char *override_file = g_strdup_printf("%s/%s.service.d/50-pacemaker.conf", SYSTEMD_OVERRIDE_ROOT, op->agent); + + method = "StopUnit"; + unlink(override_file); diff --git a/SOURCES/bz1198886-382efe0-hint-lrmd-sd-notify-not-required-4.patch b/SOURCES/bz1198886-382efe0-hint-lrmd-sd-notify-not-required-4.patch new file mode 100644 index 0000000..2e073c1 --- /dev/null +++ b/SOURCES/bz1198886-382efe0-hint-lrmd-sd-notify-not-required-4.patch @@ -0,0 +1,30 @@ +From 382efe0f55e9accb30193cbbb80d7c9d423bea25 Mon Sep 17 00:00:00 2001 +From: Andrew Beekhof +Date: Tue, 21 Apr 2015 08:04:10 +1000 +Subject: [PATCH] Fix: lrmd: Hint to child processes that using sd_notify is + not required + +--- + lrmd/main.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/lrmd/main.c b/lrmd/main.c +index 4c588be..636cf44 100644 +--- a/lrmd/main.c ++++ b/lrmd/main.c +@@ -312,6 +312,12 @@ main(int argc, char **argv) + } + } + ++ /* The presence of this variable allegedly controls whether child ++ * processes like httpd will try and use Systemd's sd_notify ++ * API ++ */ ++ unsetenv("NOTIFY_SOCKET"); ++ + /* Used by RAs - Leave owned by root */ + crm_build_path(CRM_RSCTMP_DIR, 0755); + +-- +1.8.4.2 + diff --git a/SOURCES/bz1198886-90d725d-dbus-after-pcmk-shutdown-3.patch b/SOURCES/bz1198886-90d725d-dbus-after-pcmk-shutdown-3.patch new file mode 100644 index 0000000..052431a --- /dev/null +++ b/SOURCES/bz1198886-90d725d-dbus-after-pcmk-shutdown-3.patch @@ -0,0 +1,31 @@ +From 90d725d8d8f535a55dde405877a028782b727cec Mon Sep 17 00:00:00 2001 +From: Andrew Beekhof +Date: Mon, 23 Mar 2015 14:43:27 +1100 +Subject: [PATCH] Fix: systemd: Tell systemd not to take DBus down from + underneath us + +--- + mcp/pacemaker.service.in | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/mcp/pacemaker.service.in b/mcp/pacemaker.service.in +index 7871167..3562608 100644 +--- a/mcp/pacemaker.service.in ++++ b/mcp/pacemaker.service.in +@@ -1,10 +1,13 @@ + [Unit] + Description=Pacemaker High Availability Cluster Manager + ++After=dbus.service + After=basic.target ++After=syslog.service + After=network.target + After=corosync.service + ++Requires=dbus.service + Requires=basic.target + Requires=network.target + Requires=corosync.service +-- +1.8.4.2 + diff --git a/SPECS/pacemaker.spec b/SPECS/pacemaker.spec index 9e787a5..c8c0602 100644 --- a/SPECS/pacemaker.spec +++ b/SPECS/pacemaker.spec @@ -55,7 +55,7 @@ Name: pacemaker Summary: Scalable High-Availability cluster resource manager Version: 1.1.12 -Release: %{pcmk_release}%{?dist}.1 +Release: %{pcmk_release}%{?dist}.2 License: GPLv2+ and LGPLv2+ Url: http://www.clusterlabs.org Group: System Environment/Daemons @@ -88,6 +88,10 @@ Patch23: bz1176210-handle-orphaned-remote-nodes.patch Patch24: pacemaker-31c6cc-enforce-colocation-fix-test.patch Patch25: pacemaker-8805f9-fix-ensure-b-with-a.patch Patch26: pacemaker-cb0f29d4.patch +Patch27: bz1198886-2ab97ec-systemd-stop-1.patch +Patch28: bz1198886-0315c57-ask-dbus-not-to-kill-on-shutdown-2.patch +Patch29: bz1198886-90d725d-dbus-after-pcmk-shutdown-3.patch +Patch30: bz1198886-382efe0-hint-lrmd-sd-notify-not-required-4.patch BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) AutoReqProv: on @@ -414,6 +418,8 @@ exit 0 %{_initrddir}/pacemaker %endif +%exclude %{_datadir}/pacemaker/report.common +%exclude %{_datadir}/pacemaker/report.collector %{_datadir}/pacemaker %{_datadir}/snmp/mibs/PCMK-MIB.txt %exclude %{_libexecdir}/pacemaker/lrmd_test @@ -481,6 +487,8 @@ exit 0 %{_sbindir}/crm_simulate %{_sbindir}/crm_report %{_sbindir}/crm_ticket +%{_datadir}/pacemaker/report.common +%{_datadir}/pacemaker/report.collector %doc %{_mandir}/man8/* %exclude %{_mandir}/man8/attrd_updater.* %exclude %{_mandir}/man8/crm_attribute.* @@ -559,6 +567,11 @@ exit 0 %changelog +* Wed Mar 18 2015 David Vossel - 1.1.12-22.2 +- Convince systemd to shutdown dbus after pacemaker. + + Resolves: rhbz#1198886 + * Wed Mar 18 2015 David Vossel - 1.1.12-22.1 - Ensure B with A, that B can not run if A can not run.