Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:GA
pacemaker.16898
0001-Shutdown-corosync-after-a-fatal-error.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Shutdown-corosync-after-a-fatal-error.patch of Package pacemaker.16898
From b2164d7a612bc3a300626ef15d2ffcde898c690b Mon Sep 17 00:00:00 2001 From: Christine Caulfield <ccaulfie@redhat.com> Date: Thu, 26 Jul 2018 08:06:45 +0100 Subject: [PATCH] Shutdown corosync after a fatal error If pacemaker shuts down due to being fenced by a non-power (eg fabric) fence agent then it should also take down corosync so that full cluster service on that node is lost, rather than just resource management. https://bugzilla.redhat.com/show_bug.cgi?id=1448221 Signed-off-by: Christine Caulfield <ccaulfie@redhat.com> --- daemons/pacemakerd/pacemakerd.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/daemons/pacemakerd/pacemakerd.c b/daemons/pacemakerd/pacemakerd.c index f64cd05ca..def2f0d23 100644 --- a/daemons/pacemakerd/pacemakerd.c +++ b/daemons/pacemakerd/pacemakerd.c @@ -21,6 +21,9 @@ #include <crm/common/mainloop.h> #include <crm/cluster/internal.h> #include <crm/cluster.h> +#ifdef SUPPORT_COROSYNC +#include <corosync/cfg.h> +#endif #include <dirent.h> #include <ctype.h> @@ -139,6 +142,28 @@ pcmk_process_exit(pcmk_child_t * child) } } +static void pcmk_exit_with_cluster(int exitcode) +{ +#ifdef SUPPORT_COROSYNC + corosync_cfg_handle_t cfg_handle; + cs_error_t err; + + if (exitcode == CRM_EX_FATAL) { + crm_info("Asking Corosync to shut down"); + err = corosync_cfg_initialize(&cfg_handle, NULL); + if (err != CS_OK) { + crm_warn("Unable to open handle to corosync to close it down. err=%d", err); + } + err = corosync_cfg_try_shutdown(cfg_handle, COROSYNC_CFG_SHUTDOWN_FLAG_IMMEDIATE); + if (err != CS_OK) { + crm_warn("Corosync shutdown failed. err=%d", err); + } + corosync_cfg_finalize(cfg_handle); + } +#endif + crm_exit(exitcode); +} + static void pcmk_child_exit(mainloop_child_t * p, pid_t pid, int core, int signo, int exitcode) { @@ -430,7 +455,7 @@ pcmk_shutdown_worker(gpointer user_data) if (fatal_error) { crm_notice("Shutting down and staying down after fatal error"); - crm_exit(CRM_EX_FATAL); + pcmk_exit_with_cluster(CRM_EX_FATAL); } return TRUE; -- 2.16.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor