jsc#PED-14899 - spec: do not treat fillup templates as configuration files - build: install the default logrotate config into /usr/etc/logrotate.d - build: create directories in /var via tmpfiles.d - build: create hacluster user and haclient group via sysusers.d - Update to version 3.0.1+20251208.f7f28ab3: - agents: Deprecate allow_stonith_disabled param for controld RA - agents: New allow_fencing_disabled param for controld RA - agents: Use case-insensitive property matching in controld RA - schemas: Deprecate stonith-timeout-ms in crm_mon output - schemas: Deprecate stonith-enabled in crm_mon output - various: New fencing-timeout-ms in crm_mon/pcmk_status output - schemas: New fencing-timeout-ms attribute in crm_mon schema - various: New fencing-enabled in crm_mon/pcmk_status output - schemas: New fencing-enabled attribute in crm_mon schema - Update to version 3.0.1+20251130.37f6466b: - tools: cibadmin --xpath --delete-all deletes all matches again - various: Use const for a few string pointer variables - Update to version 3.0.1+20251125.39c07b64: - cts: Respect cts-lab --nic option if specified for IPv4 (gh#ClusterLabs/pacemaker#3986) - cts: cts-lab --nic option defaults to eth0 only for an IPv6 link local address (gh#ClusterLabs/pacemaker#3986) - Update to version 3.0.1+20251124.253fbe4c: - controller: Ask attribute manager to purge fenced nodes' attributes - controller: Don't purge transient attributes on node loss (gh#ClusterLabs/pacemaker#3991) OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/pacemaker?expand=0&rev=423
100 lines
3.5 KiB
Diff
100 lines
3.5 KiB
Diff
commit 1e01228825eb8d4449edfbb1a1fa0c38fab4d5e6
|
|
Author: Gao,Yan <ygao@suse.com>
|
|
Date: Thu Sep 6 15:14:58 2012 +0800
|
|
|
|
Medium: stonith: Expose IDs of stonith resources to stonith agents through "$CRM_meta_st_device_id" environment variable
|
|
|
|
Index: pacemaker-3.0.1+20251119.6fa73e16/daemons/fenced/fenced_commands.c
|
|
===================================================================
|
|
--- pacemaker-3.0.1+20251119.6fa73e16.orig/daemons/fenced/fenced_commands.c
|
|
+++ pacemaker-3.0.1+20251119.6fa73e16/daemons/fenced/fenced_commands.c
|
|
@@ -1181,6 +1181,7 @@ build_device_from_xml(const xmlNode *dev
|
|
(const char *) device->on_target_actions->str);
|
|
}
|
|
|
|
+ g_hash_table_insert(device->params, strdup(CRM_META "_" PCMK__XE_ST_DEVICE_ID), strdup(device->id));
|
|
device->work = mainloop_add_trigger(G_PRIORITY_HIGH, stonith_device_dispatch, device);
|
|
|
|
return device;
|
|
Index: pacemaker-3.0.1+20251119.6fa73e16/lib/fencing/st_actions.c
|
|
===================================================================
|
|
--- pacemaker-3.0.1+20251119.6fa73e16.orig/lib/fencing/st_actions.c
|
|
+++ pacemaker-3.0.1+20251119.6fa73e16/lib/fencing/st_actions.c
|
|
@@ -33,6 +33,7 @@ struct stonith_action_s {
|
|
char *agent;
|
|
char *action;
|
|
GHashTable *args;
|
|
+ char *dev_id;
|
|
int timeout;
|
|
bool async;
|
|
void *userdata;
|
|
@@ -217,6 +218,7 @@ stonith__destroy_action(stonith_action_t
|
|
services_action_free(action->svc_action);
|
|
}
|
|
pcmk__reset_result(&(action->result));
|
|
+ free(action->dev_id);
|
|
free(action);
|
|
}
|
|
}
|
|
@@ -274,12 +276,19 @@ stonith__action_create(const char *agent
|
|
if (device_args) {
|
|
char *buffer = pcmk__assert_asprintf("pcmk_%s_retries", action_name);
|
|
const char *value = g_hash_table_lookup(device_args, buffer);
|
|
+ const char *st_dev_id_key = CRM_META "_" PCMK__XE_ST_DEVICE_ID;
|
|
+ const char *st_dev_id_value = NULL;
|
|
|
|
free(buffer);
|
|
|
|
if (value) {
|
|
action->max_retries = atoi(value);
|
|
}
|
|
+
|
|
+ st_dev_id_value = g_hash_table_lookup(device_args, st_dev_id_key);
|
|
+ if (st_dev_id_value) {
|
|
+ action->dev_id = strdup(st_dev_id_value);
|
|
+ }
|
|
}
|
|
|
|
return action;
|
|
@@ -641,6 +650,10 @@ internal_stonith_action_execute(stonith_
|
|
return -E2BIG;
|
|
}
|
|
|
|
+ if (action->dev_id) {
|
|
+ svc_action->rsc = strdup(action->dev_id);
|
|
+ }
|
|
+
|
|
/* keep retries from executing out of control and free previous results */
|
|
if (is_retry) {
|
|
pcmk__reset_result(&(action->result));
|
|
Index: pacemaker-3.0.1+20251119.6fa73e16/lib/services/services_linux.c
|
|
===================================================================
|
|
--- pacemaker-3.0.1+20251119.6fa73e16.orig/lib/services/services_linux.c
|
|
+++ pacemaker-3.0.1+20251119.6fa73e16/lib/services/services_linux.c
|
|
@@ -26,6 +26,9 @@
|
|
#include "crm/services.h"
|
|
#include "crm/services_internal.h"
|
|
|
|
+#include "crm/stonith-ng.h"
|
|
+#include "crm/fencing/internal.h"
|
|
+
|
|
#include "services_private.h"
|
|
|
|
static const char *filter_dir = NULL;
|
|
@@ -472,6 +475,15 @@ static void
|
|
add_action_env_vars(const svc_action_t *op)
|
|
{
|
|
void (*env_setter)(gpointer, gpointer, gpointer) = NULL;
|
|
+
|
|
+ if (pcmk__str_eq(op->standard, PCMK_RESOURCE_CLASS_STONITH, pcmk__str_casei)
|
|
+ && pcmk__str_eq(op->agent, "fence_legacy", pcmk__str_casei)
|
|
+ && op->rsc != NULL) {
|
|
+ const char *st_dev_id_key = CRM_META "_" PCMK__XE_ST_DEVICE_ID;
|
|
+
|
|
+ setenv(st_dev_id_key, op->rsc, 1);
|
|
+ }
|
|
+
|
|
if (op->agent == NULL) {
|
|
env_setter = set_alert_env; /* we deal with alert handler */
|
|
|