Hello community, here is the log from the commit of package pacemaker for openSUSE:Factory checked in at 2015-12-13 09:36:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pacemaker (Old) and /work/SRC/openSUSE:Factory/.pacemaker.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "pacemaker" Changes: -------- --- /work/SRC/openSUSE:Factory/pacemaker/pacemaker.changes 2015-11-17 14:21:44.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.pacemaker.new/pacemaker.changes 2015-12-13 09:36:11.000000000 +0100 @@ -1,0 +2,15 @@ +Wed Dec 2 11:55:11 UTC 2015 - y...@suse.com + +- ping: Clarify the description of host_list parameter in ping metadata (bsc#956459) +- systemd: Prevent segfaul when logging failed operations +- systemd: The underlying systemd calls default to 90s for their timeouts +- cib: Do not terminate due to badly behaving clients +- Correctly check for recycled PIDs in crm_pid_active +- crmd: Consider only fence and shutdown transition events to be "down" events +- pengine: Support of multiple-active=block for resource groups (bsc#942491) +- crmd: use 300s timeout with notification scripts, not 300ms +- stonith_admin: add ability to target topology by pattern or attribute +- fencing,libfencing: add API support for targeting topology by pattern or attribute +- Upstream version cs: a7d6e6b56fd2779a07970df7de4e0fb0b22742d3 + +------------------------------------------------------------------- @@ -371 +386 @@ -- lrmd: Hint to child processes that using sd_notify is not required +- lrmd: Hint to child processes that using sd_notify is not required (bsc#956626) Old: ---- pacemaker-1.1.13+git20151111.6f22ad7.tar.bz2 New: ---- pacemaker-1.1.13+git20151201.a7d6e6b.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pacemaker.spec ++++++ --- /var/tmp/diff_new_pack.dQXylv/_old 2015-12-13 09:36:12.000000000 +0100 +++ /var/tmp/diff_new_pack.dQXylv/_new 2015-12-13 09:36:12.000000000 +0100 @@ -100,7 +100,7 @@ Summary: Scalable High-Availability cluster resource manager License: GPL-2.0+ and LGPL-2.1+ Group: Productivity/Clustering/HA -Version: 1.1.13+git20151111.6f22ad7 +Version: 1.1.13+git20151201.a7d6e6b Release: 0 #Release: %{pcmk_release}%{?dist} Url: http://www.clusterlabs.org ++++++ _service ++++++ --- /var/tmp/diff_new_pack.dQXylv/_old 2015-12-13 09:36:12.000000000 +0100 +++ /var/tmp/diff_new_pack.dQXylv/_new 2015-12-13 09:36:12.000000000 +0100 @@ -11,7 +11,7 @@ <param name="version">1.1.13</param> --> <param name="versionformat">1.1.13+git%cd.%h</param> - <param name="revision">6f22ad7312b703289da5d24e918a78117a0825e1</param> + <param name="revision">a7d6e6b56fd2779a07970df7de4e0fb0b22742d3</param> </service> <service name="recompress" mode="disabled"> ++++++ pacemaker-1.1.13+git20151111.6f22ad7.tar.bz2 -> pacemaker-1.1.13+git20151201.a7d6e6b.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/attrd/commands.c new/pacemaker-1.1.13+git20151201.a7d6e6b/attrd/commands.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/attrd/commands.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/attrd/commands.c 2015-12-02 12:32:28.000000000 +0100 @@ -962,7 +962,7 @@ /* Iterate over each peer value of this attribute */ g_hash_table_iter_init(&iter, a->values); while (g_hash_table_iter_next(&iter, NULL, (gpointer *) & v)) { - crm_node_t *peer = crm_get_peer_full(v->nodeid, v->nodename, CRM_GET_PEER_REMOTE|CRM_GET_PEER_CLUSTER); + crm_node_t *peer = crm_get_peer_full(v->nodeid, v->nodename, CRM_GET_PEER_ANY); /* If the value's peer info does not correspond to a peer, ignore it */ if (peer == NULL) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/cib/callbacks.c new/pacemaker-1.1.13+git20151201.a7d6e6b/cib/callbacks.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/cib/callbacks.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/cib/callbacks.c 2015-12-02 12:32:28.000000000 +0100 @@ -267,7 +267,7 @@ } if (is_set(call_options, cib_sync_call)) { - CRM_ASSERT(flags & crm_ipc_client_response); + CRM_LOG_ASSERT(flags & crm_ipc_client_response); CRM_LOG_ASSERT(cib_client->request_id == 0); /* This means the client has two synchronous events in-flight */ cib_client->request_id = id; /* Reply only to the last one */ } @@ -286,7 +286,7 @@ crm_xml_add(op_request, F_CIB_CLIENTNAME, cib_client->name); #if ENABLE_ACL - CRM_ASSERT(cib_client->user != NULL); + CRM_LOG_ASSERT(cib_client->user != NULL); crm_acl_get_set_user(op_request, F_CIB_USER, cib_client->user); #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/cib.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/cib.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/cib.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/cib.c 2015-12-02 12:32:28.000000000 +0100 @@ -239,3 +239,20 @@ } } } + +/*! + * \internal + * \brief Get CIB call options to use local scope if master unavailable + * + * \return CIB call options + */ +int crmd_cib_smart_opt() +{ + int call_opt = cib_quorum_override; + + if (fsa_state == S_ELECTION || fsa_state == S_PENDING) { + crm_info("Sending update to local CIB in state: %s", fsa_state2string(fsa_state)); + call_opt |= cib_scope_local; + } + return call_opt; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/crmd_fsa.h new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/crmd_fsa.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/crmd_fsa.h 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/crmd_fsa.h 2015-12-02 12:32:28.000000000 +0100 @@ -116,6 +116,7 @@ /* these two should be moved elsewhere... */ extern void do_update_cib_nodes(gboolean overwrite, const char *caller); +int crmd_cib_smart_opt(void); # define AM_I_DC is_set(fsa_input_register, R_THE_DC) # define AM_I_OPERATIONAL (is_set(fsa_input_register, R_STARTING)==FALSE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/lrm.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/lrm.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/lrm.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/lrm.c 2015-12-02 12:32:28.000000000 +0100 @@ -2194,16 +2194,11 @@ */ int rc = pcmk_ok; xmlNode *update, *iter = NULL; - int call_opt = cib_quorum_override; + int call_opt = crmd_cib_smart_opt(); const char *uuid = NULL; CRM_CHECK(op != NULL, return 0); - if (fsa_state == S_ELECTION || fsa_state == S_PENDING) { - crm_info("Sending update to local CIB in state: %s", fsa_state2string(fsa_state)); - call_opt |= cib_scope_local; - } - iter = create_xml_node(iter, XML_CIB_TAG_STATUS); update = iter; iter = create_xml_node(iter, XML_CIB_TAG_STATE); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/lrm_state.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/lrm_state.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/lrm_state.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/lrm_state.c 2015-12-02 12:32:28.000000000 +0100 @@ -85,7 +85,6 @@ event.op_status = PCMK_LRM_OP_ERROR; event.t_run = op->start_time; event.t_rcchange = op->start_time; - event.t_rcchange = op->start_time; event.call_id = op->call_id; event.remote_nodename = lrm_state->node_name; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/notify.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/notify.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/notify.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/notify.c 2015-12-02 12:32:28.000000000 +0100 @@ -108,7 +108,7 @@ notify = services_action_create_generic(notify_script, NULL); - notify->timeout = 300; + notify->timeout = CRMD_NOTIFY_TIMEOUT_MS; notify->standard = strdup("event"); notify->id = strdup(notify_script); notify->agent = strdup(notify_script); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/notify.h new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/notify.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/notify.h 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/notify.h 2015-12-02 12:32:28.000000000 +0100 @@ -22,6 +22,9 @@ # include <crm/cluster.h> # include <crm/stonith-ng.h> +/* Timeout to use before killing a notification script (in milliseconds) */ +# define CRMD_NOTIFY_TIMEOUT_MS (300000) + void crmd_enable_notifications(const char *script, const char *target); void crmd_notify_node_event(crm_node_t *node); void crmd_notify_fencing_op(stonith_event_t * e); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_actions.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_actions.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_actions.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_actions.c 2015-12-02 12:32:28.000000000 +0100 @@ -72,7 +72,7 @@ CRM_CHECK(uuid != NULL, return); /* Make sure the membership and join caches are accurate */ - peer = crm_get_peer_full(0, target, CRM_GET_PEER_CLUSTER | CRM_GET_PEER_REMOTE); + peer = crm_get_peer_full(0, target, CRM_GET_PEER_ANY); CRM_CHECK(peer != NULL, return); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_callbacks.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_callbacks.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_callbacks.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_callbacks.c 2015-12-02 12:32:28.000000000 +0100 @@ -716,7 +716,6 @@ goto bail; } - /* this will mark the event complete if a match is found */ action = get_action(stonith_id, FALSE); if (action == NULL) { crm_err("Stonith action not matched"); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_events.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_events.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_events.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_events.c 2015-12-02 12:32:28.000000000 +0100 @@ -458,6 +458,18 @@ return NULL; } +/*! + * \brief Find a transition event that would have made a specified node down + * + * \param[in] id If nonzero, also consider this action ID a match + * \param[in] target UUID of node to match + * \param[in] filter If not NULL, only match CRM actions of this type + * \param[in] quiet If FALSE, log a warning if no match found + * + * \return Matching event if found, NULL otherwise + * + * \note "Down" events are CRM_OP_FENCE and CRM_OP_SHUTDOWN. + */ crm_action_t * match_down_event(int id, const char *target, const char *filter, bool quiet) { @@ -487,10 +499,11 @@ if (action->type != action_type_crm) { continue; - } else if (safe_str_eq(this_action, CRM_OP_LRM_REFRESH)) { + } else if (filter != NULL && safe_str_neq(this_action, filter)) { continue; - } else if (filter != NULL && safe_str_neq(this_action, filter)) { + } else if (safe_str_neq(this_action, CRM_OP_FENCE) + && safe_str_neq(this_action, CRM_OP_SHUTDOWN)) { continue; } @@ -501,7 +514,8 @@ } if (safe_str_neq(this_node, target)) { - crm_debug("Action %d : Node mismatch: %s", action->id, this_node); + crm_trace("Action %d node %s is not a match for %s", + action->id, this_node, target); continue; } @@ -511,13 +525,11 @@ } if (match != NULL) { - /* stop this event's timer if it had one */ break; } } if (match != NULL) { - /* stop this event's timer if it had one */ crm_debug("Match found for action %d: %s on %s", id, crm_element_value(match->xml, XML_LRM_ATTR_TASK_KEY), target); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_utils.c new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_utils.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/crmd/te_utils.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/crmd/te_utils.c 2015-12-02 12:32:28.000000000 +0100 @@ -315,7 +315,7 @@ #endif if (st_event->result == pcmk_ok) { - crm_node_t *peer = crm_find_peer_full(0, st_event->target, CRM_GET_PEER_REMOTE | CRM_GET_PEER_CLUSTER); + crm_node_t *peer = crm_find_peer_full(0, st_event->target, CRM_GET_PEER_ANY); const char *uuid = NULL; gboolean we_are_executioner = safe_str_eq(st_event->executioner, fsa_our_uname); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/extra/resources/ping new/pacemaker-1.1.13+git20151201.a7d6e6b/extra/resources/ping --- old/pacemaker-1.1.13+git20151111.6f22ad7/extra/resources/ping 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/extra/resources/ping 2015-12-02 12:32:28.000000000 +0100 @@ -81,7 +81,7 @@ <parameter name="host_list" unique="0" required="1"> <longdesc lang="en"> -The list of ping nodes to count. +A space separated list of ping nodes to count. </longdesc> <shortdesc lang="en">Host list</shortdesc> <content type="string" default=""/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/admin.c new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/admin.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/admin.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/admin.c 2015-12-02 12:32:28.000000000 +0100 @@ -26,6 +26,7 @@ #include <sys/utsname.h> #include <stdlib.h> +#include <string.h> #include <errno.h> #include <fcntl.h> @@ -69,10 +70,10 @@ {"deregister", 1, 0, 'D', "De-register the named stonith device"}, {"register-level", 1, 0, 'r', - "Register a stonith level for the named target (a node name\n\t" - "pattern, or a node attribute NAME=VALUE pair).\n\t" - "Requires: --index, one or more --device entries"}, - {"deregister-level", 1, 0, 'd', "De-register a stonith level for the named target. Requires: --index"}, + "Register a stonith level for the named target, specified as one of:\n\t" + "NAME, @PATTERN, or ATTR=VALUE. Requires: --index, one or more --device entries"}, + {"deregister-level", 1, 0, 'd', "De-register a stonith level for the named target\n\t" + "Target is specified as for --register-level. Requires: --index"}, {"-spacer-", 0, 0, '-', ""}, {"-spacer-", 0, 0, '-', "Options and modifiers:"}, @@ -209,6 +210,35 @@ return async_fence_data.rc; } +static int +handle_level(stonith_t *st, char *target, int fence_level, + stonith_key_value_t *devices, bool added) +{ + char *node = NULL; + char *pattern = NULL; + char *name = NULL; + char *value = strchr(target, '='); + + /* Determine if targeting by attribute, node name pattern or node name */ + if (value != NULL) { + name = target; + *value++ = '\0'; + } else if (*target == '@') { + pattern = target + 1; + } else { + node = target; + } + + /* Register or unregister level as appropriate */ + if (added) { + return st->cmds->register_level_full(st, st_opts, node, pattern, + name, value, fence_level, + devices); + } + return st->cmds->remove_level_full(st, st_opts, node, pattern, + name, value, fence_level); +} + int main(int argc, char **argv) { @@ -226,9 +256,9 @@ char *name = NULL; char *value = NULL; + char *target = NULL; const char *agent = NULL; const char *device = NULL; - const char *target = NULL; const char *longname = NULL; char action = 0; @@ -420,11 +450,9 @@ case 'D': rc = st->cmds->remove_device(st, st_opts, device); break; - case 'r': - rc = st->cmds->register_level(st, st_opts, target, fence_level, devices); - break; case 'd': - rc = st->cmds->remove_level(st, st_opts, target, fence_level); + case 'r': + rc = handle_level(st, target, fence_level, devices, action == 'r'); break; case 'M': if (agent == NULL) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/commands.c new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/commands.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/commands.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/commands.c 2015-12-02 12:32:28.000000000 +0100 @@ -2428,53 +2428,29 @@ } else if (crm_str_eq(op, STONITH_OP_DEVICE_ADD, TRUE)) { const char *id = NULL; - xmlNode *notify_data = create_xml_node(NULL, op); rc = stonith_device_register(request, &id, FALSE); - - crm_xml_add(notify_data, F_STONITH_DEVICE, id); - crm_xml_add_int(notify_data, F_STONITH_ACTIVE, g_hash_table_size(device_list)); - - do_stonith_notify(call_options, op, rc, notify_data); - free_xml(notify_data); + do_stonith_notify_device(call_options, op, rc, id); } else if (crm_str_eq(op, STONITH_OP_DEVICE_DEL, TRUE)) { xmlNode *dev = get_xpath_object("//" F_STONITH_DEVICE, request, LOG_ERR); const char *id = crm_element_value(dev, XML_ATTR_ID); - xmlNode *notify_data = create_xml_node(NULL, op); rc = stonith_device_remove(id, FALSE); - - crm_xml_add(notify_data, F_STONITH_DEVICE, id); - crm_xml_add_int(notify_data, F_STONITH_ACTIVE, g_hash_table_size(device_list)); - - do_stonith_notify(call_options, op, rc, notify_data); - free_xml(notify_data); + do_stonith_notify_device(call_options, op, rc, id); } else if (crm_str_eq(op, STONITH_OP_LEVEL_ADD, TRUE)) { char *id = NULL; - xmlNode *notify_data = create_xml_node(NULL, op); rc = stonith_level_register(request, &id); - - crm_xml_add(notify_data, F_STONITH_DEVICE, id); - crm_xml_add_int(notify_data, F_STONITH_ACTIVE, g_hash_table_size(topology)); - - do_stonith_notify(call_options, op, rc, notify_data); - free_xml(notify_data); + do_stonith_notify_level(call_options, op, rc, id); free(id); } else if (crm_str_eq(op, STONITH_OP_LEVEL_DEL, TRUE)) { char *id = NULL; - xmlNode *notify_data = create_xml_node(NULL, op); rc = stonith_level_remove(request, &id); - - crm_xml_add(notify_data, F_STONITH_DEVICE, id); - crm_xml_add_int(notify_data, F_STONITH_ACTIVE, g_hash_table_size(topology)); - - do_stonith_notify(call_options, op, rc, notify_data); - free_xml(notify_data); + do_stonith_notify_level(call_options, op, rc, id); } else if (crm_str_eq(op, STONITH_OP_CONFIRM, TRUE)) { async_command_t *cmd = create_async_command(request); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/internal.h new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/internal.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/internal.h 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/internal.h 2015-12-02 12:32:28.000000000 +0100 @@ -198,6 +198,8 @@ do_stonith_async_timeout_update(const char *client, const char *call_id, int timeout); void do_stonith_notify(int options, const char *type, int result, xmlNode * data); +void do_stonith_notify_device(int options, const char *op, int rc, const char *desc); +void do_stonith_notify_level(int options, const char *op, int rc, const char *desc); remote_fencing_op_t *initiate_remote_stonith_op(crm_client_t * client, xmlNode * request, gboolean manual_ack); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/main.c new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/main.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/main.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/main.c 2015-12-02 12:32:28.000000000 +0100 @@ -394,25 +394,46 @@ } static void +do_stonith_notify_config(int options, const char *op, int rc, + const char *desc, int active) +{ + xmlNode *notify_data = create_xml_node(NULL, op); + + CRM_CHECK(notify_data != NULL, return); + + crm_xml_add(notify_data, F_STONITH_DEVICE, desc); + crm_xml_add_int(notify_data, F_STONITH_ACTIVE, active); + + do_stonith_notify(options, op, rc, notify_data); + free_xml(notify_data); +} + +void +do_stonith_notify_device(int options, const char *op, int rc, const char *desc) +{ + do_stonith_notify_config(options, op, rc, desc, g_hash_table_size(device_list)); +} + +void +do_stonith_notify_level(int options, const char *op, int rc, const char *desc) +{ + do_stonith_notify_config(options, op, rc, desc, g_hash_table_size(topology)); +} + +static void topology_remove_helper(const char *node, int level) { int rc; char *desc = NULL; xmlNode *data = create_xml_node(NULL, XML_TAG_FENCING_LEVEL); - xmlNode *notify_data = create_xml_node(NULL, STONITH_OP_LEVEL_DEL); crm_xml_add(data, F_STONITH_ORIGIN, __FUNCTION__); crm_xml_add_int(data, XML_ATTR_STONITH_INDEX, level); crm_xml_add(data, XML_ATTR_STONITH_TARGET, node); rc = stonith_level_remove(data, &desc); + do_stonith_notify_level(0, STONITH_OP_LEVEL_DEL, rc, desc); - crm_xml_add(notify_data, F_STONITH_DEVICE, desc); - crm_xml_add_int(notify_data, F_STONITH_ACTIVE, g_hash_table_size(topology)); - - do_stonith_notify(0, STONITH_OP_LEVEL_DEL, rc, notify_data); - - free_xml(notify_data); free_xml(data); free(desc); } @@ -447,13 +468,8 @@ { int rc; char *desc = NULL; - xmlNode *notify_data = create_xml_node(NULL, STONITH_OP_LEVEL_ADD); - - CRM_LOG_ASSERT(match != NULL); - if(match == NULL) { - return; - } + CRM_CHECK(match != NULL, return); crm_trace("Updating %s", ID(match)); if(remove) { @@ -466,14 +482,8 @@ } rc = stonith_level_register(match, &desc); - notify_data = create_xml_node(NULL, STONITH_OP_LEVEL_ADD); - - crm_xml_add(notify_data, F_STONITH_DEVICE, desc); - crm_xml_add_int(notify_data, F_STONITH_ACTIVE, g_hash_table_size(topology)); - - do_stonith_notify(0, STONITH_OP_LEVEL_ADD, rc, notify_data); + do_stonith_notify_level(0, STONITH_OP_LEVEL_ADD, rc, desc); - free_xml(notify_data); free(desc); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/regression.py.in new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/regression.py.in --- old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/regression.py.in 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/regression.py.in 2015-12-02 12:32:28.000000000 +0100 @@ -618,6 +618,33 @@ test.add_stonith_log_pattern("for host 'node3' with device 'true3' returned: 0") test.add_stonith_log_pattern("for host 'node3' with device 'true4' returned: 0") + # Test targeting a topology level by node name pattern. + for test_type in test_types: + if test_type["use_cpg"] == 0: + continue + + test = self.new_test("%s_topology_level_pattern" % test_type["prefix"], + "Verify targeting topology by node name pattern works.", test_type["use_cpg"]) + test.add_cmd("stonith_admin", + """-R true -a fence_dummy -o "mode=pass" -o "pcmk_host_list=node1 node2 node3" """) + test.add_cmd("stonith_admin", """-r '@node.*' -i 1 -v true""") + test.add_cmd("stonith_admin", "-F node3 -t 2") + test.add_stonith_log_pattern("for host 'node3' with device 'true' returned: 0") + + # test allowing commas and semicolons as delimiters in pcmk_host_list + for test_type in test_types: + test = self.new_test("%s_host_list_delimiters" % test_type["prefix"], + "Verify commas and semicolons can be used as pcmk_host_list delimiters", + test_type["use_cpg"]) + test.add_cmd("stonith_admin", + """-R true1 -a fence_dummy -o "mode=pass" -o "pcmk_host_list=node1,node2,node3" """) + test.add_cmd("stonith_admin", + """-R true2 -a fence_dummy -o "mode=pass" -o "pcmk_host_list=pcmk1;pcmk2;pcmk3" """) + test.add_cmd("stonith_admin", "stonith_admin -F node2 -t 2") + test.add_cmd("stonith_admin", "stonith_admin -F pcmk3 -t 2") + test.add_stonith_log_pattern("for host 'node2' with device 'true1' returned: 0") + test.add_stonith_log_pattern("for host 'pcmk3' with device 'true2' returned: 0") + # test the stonith builds the correct list of devices that can fence a node. for test_type in test_types: test = self.new_test("%s_list_devices" % test_type["prefix"], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/remote.c new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/remote.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/remote.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/remote.c 2015-12-02 12:32:28.000000000 +0100 @@ -1450,15 +1450,15 @@ if (device) { timeout_one = TIMEOUT_MULTIPLY_FACTOR * get_device_timeout(op, peer, device); - crm_info("Requesting that %s perform op %s %s with %s for %s (%ds)", peer->host, - op->action, op->target, device, op->client_name, timeout_one); + crm_info("Requesting that '%s' perform op '%s %s' with '%s' for %s (%ds)", peer->host, + op->target, op->action, device, op->client_name, timeout_one); crm_xml_add(remote_op, F_STONITH_DEVICE, device); crm_xml_add(remote_op, F_STONITH_MODE, "slave"); } else { timeout_one = TIMEOUT_MULTIPLY_FACTOR * get_peer_timeout(op, peer); - crm_info("Requesting that %s perform op %s %s for %s (%ds, %ds)", - peer->host, op->action, op->target, op->client_name, timeout_one, stonith_watchdog_timeout_ms); + crm_info("Requesting that '%s' perform op '%s %s' for %s (%ds, %ds)", + peer->host, op->target, op->action, op->client_name, timeout_one, stonith_watchdog_timeout_ms); crm_xml_add(remote_op, F_STONITH_MODE, "smart"); } @@ -1934,8 +1934,8 @@ if (is_set(op->call_options, st_opt_topology)) { const char *device = crm_element_value(msg, F_STONITH_DEVICE); - crm_notice("Call to %s for %s on behalf of %s@%s: %s (%d)", - device, op->target, op->client_name, op->originator, + crm_notice("Call to %s for '%s %s' on behalf of %s@%s: %s (%d)", + device, op->target, op->action, op->client_name, op->originator, pcmk_strerror(rc), rc); /* We own the op, and it is complete. broadcast the result to all nodes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/standalone_config.c new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/standalone_config.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/fencing/standalone_config.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/fencing/standalone_config.c 2015-12-02 12:32:28.000000000 +0100 @@ -272,7 +272,7 @@ for (i = 0; i < topo->priority_levels_count; i++) { devices = stonith_key_value_add(devices, NULL, topo->priority_levels[i].device_name); - data = create_level_registration_xml(topo->node_name, + data = create_level_registration_xml(topo->node_name, NULL, NULL, NULL, topo->priority_levels[i].level, devices); dump = dump_xml_formatted(data); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/cluster/internal.h new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/cluster/internal.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/cluster/internal.h 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/cluster/internal.h 2015-12-02 12:32:28.000000000 +0100 @@ -457,6 +457,7 @@ crm_node_t *crm_update_peer_state(const char *source, crm_node_t * node, const char *state, int membership); +void crm_update_peer_uname(crm_node_t *node, const char *uname); void crm_update_peer_expected(const char *source, crm_node_t * node, const char *expected); void crm_reap_unseen_nodes(uint64_t ring_id); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/cluster.h new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/cluster.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/cluster.h 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/cluster.h 2015-12-02 12:32:28.000000000 +0100 @@ -139,6 +139,7 @@ enum crm_get_peer_flags { CRM_GET_PEER_CLUSTER = 0x0001, CRM_GET_PEER_REMOTE = 0x0002, + CRM_GET_PEER_ANY = CRM_GET_PEER_CLUSTER|CRM_GET_PEER_REMOTE, }; /* *INDENT-ON* */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/common/xml.h new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/common/xml.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/common/xml.h 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/common/xml.h 2015-12-02 12:32:28.000000000 +0100 @@ -101,6 +101,24 @@ const char *crm_xml_add_int(xmlNode * node, const char *name, int value); +/*! + * \brief Add a boolean attribute to an XML object + * + * Add an attribute with the value XML_BOOLEAN_TRUE or XML_BOOLEAN_FALSE + * as appropriate to an XML object. + * + * \param[in/out] node XML object to add attribute to + * \param[in] name Name of attribute to add + * \param[in] value Boolean whose value will be tested + * + * \return Pointer to newly created XML attribute's content, or NULL on error + */ +static inline const char * +crm_xml_add_boolean(xmlNode *node, const char *name, gboolean value) +{ + return crm_xml_add(node, name, (value? "true" : "false")); +} + /* * Unlink the node and set its doc pointer to NULL so free_xml() * will act appropriately diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/fencing/internal.h new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/fencing/internal.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/fencing/internal.h 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/fencing/internal.h 2015-12-02 12:32:28.000000000 +0100 @@ -42,8 +42,10 @@ gboolean is_redhat_agent(const char *agent); -xmlNode *create_level_registration_xml(const char *node, int level, - stonith_key_value_t * device_list); +xmlNode *create_level_registration_xml(const char *node, const char *pattern, + const char *attr, const char *value, + int level, + stonith_key_value_t *device_list); xmlNode *create_device_registration_xml(const char *id, const char *namespace, const char *agent, stonith_key_value_t * params, const char *rsc_provides); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/stonith-ng.h new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/stonith-ng.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm/stonith-ng.h 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm/stonith-ng.h 2015-12-02 12:32:28.000000000 +0100 @@ -314,6 +314,48 @@ */ int (*remove_callback)(stonith_t *st, int call_id, bool all_callbacks); + /*! + * \brief Remove fencing level for specific node, node regex or attribute + * + * \param[in] st Stonithd connection to use + * \param[in] options Bitmask of stonith_call_options to pass to stonithd + * \param[in] node If not NULL, target level by this node name + * \param[in] pattern If not NULL, target by node name using this regex + * \param[in] attr If not NULL, target by this node attribute + * \param[in] value If not NULL, target by this node attribute value + * \param[in] level Index number of level to remove + * + * \return 0 on success, negative error code otherwise + * + * \note This feature is not available when stonith is in standalone mode. + * The caller should set only one of node, pattern or attr/value. + */ + int (*remove_level_full)(stonith_t *st, int options, + const char *node, const char *pattern, + const char *attr, const char *value, int level); + + /*! + * \brief Register fencing level for specific node, node regex or attribute + * + * \param[in] st Stonithd connection to use + * \param[in] options Bitmask of stonith_call_options to pass to stonithd + * \param[in] node If not NULL, target level by this node name + * \param[in] pattern If not NULL, target by node name using this regex + * \param[in] attr If not NULL, target by this node attribute + * \param[in] value If not NULL, target by this node attribute value + * \param[in] level Index number of level to add + * \param[in] device_list Devices to use in level + * + * \return 0 on success, negative error code otherwise + * + * \note This feature is not available when stonith is in standalone mode. + * The caller should set only one of node, pattern or attr/value. + */ + int (*register_level_full)(stonith_t *st, int options, + const char *node, const char *pattern, + const char *attr, const char *value, + int level, stonith_key_value_t *device_list); + } stonith_api_operations_t; struct stonith_s diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm_internal.h new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm_internal.h --- old/pacemaker-1.1.13+git20151111.6f22ad7/include/crm_internal.h 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/include/crm_internal.h 2015-12-02 12:32:28.000000000 +0100 @@ -154,7 +154,7 @@ char *add_list_element(char *list, const char *value); -int crm_pid_active(long pid); +int crm_pid_active(long pid, const char *daemon); void crm_make_daemon(const char *name, gboolean daemonize, const char *pidfile); char *generate_op_key(const char *rsc_id, const char *op_type, int interval); @@ -263,7 +263,7 @@ void pcmk_panic(const char *origin); void sysrq_init(void); pid_t pcmk_locate_sbd(void); -int crm_pidfile_inuse(const char *filename, long mypid); +int crm_pidfile_inuse(const char *filename, long mypid, const char *daemon); int crm_read_pidfile(const char *filename); # define crm_config_err(fmt...) { crm_config_error = TRUE; crm_err(fmt); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/cluster/membership.c new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/cluster/membership.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/cluster/membership.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/cluster/membership.c 2015-12-02 12:32:28.000000000 +0100 @@ -563,27 +563,8 @@ node->id = id; } - if(uname && node->uname == NULL) { - int lpc, len = strlen(uname); - - for (lpc = 0; lpc < len; lpc++) { - if (uname[lpc] >= 'A' && uname[lpc] <= 'Z') { - crm_warn("Node names with capitals are discouraged, consider changing '%s' to something else", - uname); - break; - } - } - - node->uname = strdup(uname); - if (crm_status_callback) { - crm_status_callback(crm_status_uname, node, NULL); - } - -#if SUPPORT_COROSYNC - if (is_openais_cluster()) { - crm_remove_conflicting_peer(node); - } -#endif + if (uname && (node->uname == NULL)) { + crm_update_peer_uname(node, uname); } if(node->uuid == NULL) { @@ -686,6 +667,43 @@ } /*! + * \internal + * \brief Update a node's uname + * + * \param[in] node Node object to update + * \param[in] uname New name to set + * + * \note This function should not be called within a peer cache iteration, + * because in some cases it can remove conflicting cache entries, + * which would invalidate the iterator. + */ +void +crm_update_peer_uname(crm_node_t *node, const char *uname) +{ + int i, len = strlen(uname); + + for (i = 0; i < len; i++) { + if (uname[i] >= 'A' && uname[i] <= 'Z') { + crm_warn("Node names with capitals are discouraged, consider changing '%s'", + uname); + break; + } + } + + free(node->uname); + node->uname = strdup(uname); + if (crm_status_callback) { + crm_status_callback(crm_status_uname, node, NULL); + } + +#if SUPPORT_COROSYNC + if (is_openais_cluster() && !is_set(node->flags, crm_remote_node)) { + crm_remove_conflicting_peer(node); + } +#endif +} + +/*! * \internal * \brief Update a node's process information (and potentially state) * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/Makefile.am new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/Makefile.am --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/Makefile.am 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/Makefile.am 2015-12-02 12:32:28.000000000 +0100 @@ -17,9 +17,10 @@ # MAINTAINERCLEANFILES = Makefile.in -AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ - -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ - -I$(top_builddir)/lib/gnu -I$(top_srcdir)/lib/gnu +AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include \ + -I$(top_builddir)/libltdl -I$(top_srcdir)/libltdl \ + -I$(top_builddir)/lib/gnu -I$(top_srcdir)/lib/gnu \ + -DSBINDIR=\"$(sbindir)\" ## libraries lib_LTLIBRARIES = libcrmcommon.la diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/procfs.c new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/procfs.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/procfs.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/procfs.c 2015-12-02 12:32:28.000000000 +0100 @@ -130,7 +130,7 @@ while ((entry = readdir(dp)) != NULL) { if ((crm_procfs_process_info(entry, entry_name, &pid) == 0) && safe_str_eq(entry_name, name) - && (crm_pid_active(pid) == 1)) { + && (crm_pid_active(pid, NULL) == 1)) { crm_info("Found %s active as process %d", name, pid); break; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/utils.c new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/utils.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/utils.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/utils.c 2015-12-02 12:32:28.000000000 +0100 @@ -1184,23 +1184,34 @@ crm_perror(LOG_ERR, "Cannot wait on forked child %d", pid); } -#define LOCKSTRLEN 11 - int -crm_pid_active(long pid) +crm_pid_active(long pid, const char *daemon) { + static int have_proc_pid = 0; + + if(have_proc_pid == 0) { + char proc_path[PATH_MAX], exe_path[PATH_MAX]; + + /* check to make sure pid hasn't been reused by another process */ + snprintf(proc_path, sizeof(proc_path), "/proc/%lu/exe", (long unsigned int)getpid()); + + have_proc_pid = 1; + if(readlink(proc_path, exe_path, PATH_MAX - 1) < 0) { + have_proc_pid = -1; + } + } + if (pid <= 0) { return -1; } else if (kill(pid, 0) < 0 && errno == ESRCH) { return 0; - } -#ifndef HAVE_PROC_PID - return 1; -#else - { + + } else if(daemon == NULL || have_proc_pid == -1) { + return 1; + + } else { int rc = 0; - int running = 0; char proc_path[PATH_MAX], exe_path[PATH_MAX], myexe_path[PATH_MAX]; /* check to make sure pid hasn't been reused by another process */ @@ -1209,28 +1220,29 @@ rc = readlink(proc_path, exe_path, PATH_MAX - 1); if (rc < 0) { crm_perror(LOG_ERR, "Could not read from %s", proc_path); - goto bail; + return 0; } exe_path[rc] = 0; - snprintf(proc_path, sizeof(proc_path), "/proc/%lu/exe", (long unsigned int)getpid()); - rc = readlink(proc_path, myexe_path, PATH_MAX - 1); - if (rc < 0) { - crm_perror(LOG_ERR, "Could not read from %s", proc_path); - goto bail; - } - myexe_path[rc] = 0; + if(daemon[0] != '/') { + rc = snprintf(myexe_path, sizeof(proc_path), CRM_DAEMON_DIR"/%s", daemon); + myexe_path[rc] = 0; + } else { + rc = snprintf(myexe_path, sizeof(proc_path), "%s", daemon); + myexe_path[rc] = 0; + } + if (strcmp(exe_path, myexe_path) == 0) { - running = 1; + return 1; } } - bail: - return running; -#endif + return 0; } +#define LOCKSTRLEN 11 + int crm_read_pidfile(const char *filename) { @@ -1260,7 +1272,7 @@ } int -crm_pidfile_inuse(const char *filename, long mypid) +crm_pidfile_inuse(const char *filename, long mypid, const char *daemon) { long pid = 0; struct stat sbuf; @@ -1285,7 +1297,7 @@ /* In use by us */ rc = pcmk_ok; - } else if (crm_pid_active(pid) == FALSE) { + } else if (crm_pid_active(pid, daemon) == FALSE) { /* Contains a stale value */ unlink(filename); rc = -ENOENT; @@ -1302,7 +1314,7 @@ } static int -crm_lock_pidfile(const char *filename) +crm_lock_pidfile(const char *name, const char *filename) { long mypid = 0; int fd = 0, rc = 0; @@ -1310,7 +1322,7 @@ mypid = (unsigned long)getpid(); - rc = crm_pidfile_inuse(filename, 0); + rc = crm_pidfile_inuse(filename, 0, name); if (rc == -ENOENT) { /* exists but the process is not active */ @@ -1333,7 +1345,7 @@ return -errno; } - return crm_pidfile_inuse(filename, mypid); + return crm_pidfile_inuse(filename, mypid, name); } void @@ -1348,7 +1360,7 @@ } /* Check before we even try... */ - rc = crm_pidfile_inuse(pidfile, 1); + rc = crm_pidfile_inuse(pidfile, 1, name); if(rc < pcmk_ok && rc != -ENOENT) { pid = crm_read_pidfile(pidfile); crm_err("%s: already running [pid %ld in %s]", name, pid, pidfile); @@ -1366,7 +1378,7 @@ crm_exit(pcmk_ok); } - rc = crm_lock_pidfile(pidfile); + rc = crm_lock_pidfile(pidfile, name); if(rc < pcmk_ok) { crm_err("Could not lock '%s' for %s: %s (%d)", pidfile, name, pcmk_strerror(rc), rc); printf("Could not lock '%s' for %s: %s (%d)\n", pidfile, name, pcmk_strerror(rc), rc); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/watchdog.c new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/watchdog.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/common/watchdog.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/common/watchdog.c 2015-12-02 12:32:28.000000000 +0100 @@ -215,6 +215,7 @@ pcmk_locate_sbd(void) { char *pidfile = NULL; + char *sbd_path = NULL; if(sbd_pid > 1) { return sbd_pid; @@ -222,10 +223,11 @@ /* Look for the pid file */ pidfile = crm_strdup_printf("%s/sbd.pid", HA_STATE_DIR); + sbd_path = crm_strdup_printf("%s/sbd", SBINDIR); /* Read the pid file */ if(pidfile) { - int rc = crm_pidfile_inuse(pidfile, 1); + int rc = crm_pidfile_inuse(pidfile, 1, sbd_path); if(rc < pcmk_ok && rc != -ENOENT) { sbd_pid = crm_read_pidfile(pidfile); crm_trace("SBD detected at pid=%d (file)"); @@ -243,5 +245,7 @@ } free(pidfile); + free(sbd_path); + return sbd_pid; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/fencing/st_client.c new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/fencing/st_client.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/fencing/st_client.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/fencing/st_client.c 2015-12-02 12:32:28.000000000 +0100 @@ -238,17 +238,28 @@ } static int -stonith_api_remove_level(stonith_t * st, int options, const char *node, int level) +stonith_api_remove_level_full(stonith_t *st, int options, + const char *node, const char *pattern, + const char *attr, const char *value, int level) { int rc = 0; xmlNode *data = NULL; + CRM_CHECK(node || pattern || (attr && value), return -EINVAL); + data = create_xml_node(NULL, XML_TAG_FENCING_LEVEL); crm_xml_add(data, F_STONITH_ORIGIN, __FUNCTION__); - /* Current versions use XML_ATTR_STONITH_TARGET, older F_STONITH_TARGET */ - crm_xml_add(data, XML_ATTR_STONITH_TARGET, node); - crm_xml_add(data, F_STONITH_TARGET, node); + if (node) { + crm_xml_add(data, XML_ATTR_STONITH_TARGET, node); + + } else if (pattern) { + crm_xml_add(data, XML_ATTR_STONITH_TARGET_PATTERN, pattern); + + } else { + crm_xml_add(data, XML_ATTR_STONITH_TARGET_ATTRIBUTE, attr); + crm_xml_add(data, XML_ATTR_STONITH_TARGET_VALUE, value); + } crm_xml_add_int(data, XML_ATTR_ID, level); rc = stonith_send_command(st, STONITH_OP_LEVEL_DEL, data, NULL, options, 0); @@ -257,17 +268,56 @@ return rc; } +static int +stonith_api_remove_level(stonith_t * st, int options, const char *node, int level) +{ + return stonith_api_remove_level_full(st, options, node, + NULL, NULL, NULL, level); +} + +/* + * \internal + * \brief Create XML for stonithd topology level registration request + * + * \param[in] node If not NULL, target level by this node name + * \param[in] pattern If not NULL, target by node name using this regex + * \param[in] attr If not NULL, target by this node attribute + * \param[in] value If not NULL, target by this node attribute value + * \param[in] level Index number of level to register + * \param[in] device_list List of devices in level + * + * \return Newly allocated XML tree on success, NULL otherwise + * + * \note The caller should set only one of node, pattern or attr/value. + */ xmlNode * -create_level_registration_xml(const char *node, int level, stonith_key_value_t * device_list) +create_level_registration_xml(const char *node, const char *pattern, + const char *attr, const char *value, + int level, stonith_key_value_t *device_list) { int len = 0; char *list = NULL; - xmlNode *data = create_xml_node(NULL, XML_TAG_FENCING_LEVEL); + xmlNode *data; + + CRM_CHECK(node || pattern || (attr && value), return NULL); + + data = create_xml_node(NULL, XML_TAG_FENCING_LEVEL); + CRM_CHECK(data, return NULL); + crm_xml_add(data, F_STONITH_ORIGIN, __FUNCTION__); crm_xml_add_int(data, XML_ATTR_ID, level); crm_xml_add_int(data, XML_ATTR_STONITH_INDEX, level); - crm_xml_add(data, XML_ATTR_STONITH_TARGET, node); - crm_xml_add(data, F_STONITH_ORIGIN, __FUNCTION__); + + if (node) { + crm_xml_add(data, XML_ATTR_STONITH_TARGET, node); + + } else if (pattern) { + crm_xml_add(data, XML_ATTR_STONITH_TARGET_PATTERN, pattern); + + } else { + crm_xml_add(data, XML_ATTR_STONITH_TARGET_ATTRIBUTE, attr); + crm_xml_add(data, XML_ATTR_STONITH_TARGET_VALUE, value); + } for (; device_list; device_list = device_list->next) { @@ -278,6 +328,7 @@ crm_trace("Adding %s (%dc) at offset %d", device_list->value, adding, len); list = realloc_safe(list, len + adding + 1); /* +1 EOS */ + CRM_CHECK(list != NULL, free_xml(data); return NULL); sprintf(list + len, "%s%s", len?",":"", device_list->value); len += adding; } @@ -289,11 +340,15 @@ } static int -stonith_api_register_level(stonith_t * st, int options, const char *node, int level, - stonith_key_value_t * device_list) +stonith_api_register_level_full(stonith_t * st, int options, const char *node, + const char *pattern, + const char *attr, const char *value, + int level, stonith_key_value_t *device_list) { int rc = 0; - xmlNode *data = create_level_registration_xml(node, level, device_list); + xmlNode *data = create_level_registration_xml(node, pattern, attr, value, + level, device_list); + CRM_CHECK(data != NULL, return -EINVAL); rc = stonith_send_command(st, STONITH_OP_LEVEL_ADD, data, NULL, options, 0); free_xml(data); @@ -301,6 +356,14 @@ return rc; } +static int +stonith_api_register_level(stonith_t * st, int options, const char *node, int level, + stonith_key_value_t * device_list) +{ + return stonith_api_register_level_full(st, options, node, NULL, NULL, NULL, + level, device_list); +} + static void append_arg(gpointer key, gpointer value, gpointer user_data) { @@ -2356,8 +2419,10 @@ new_stonith->cmds->remove_device = stonith_api_remove_device; new_stonith->cmds->register_device = stonith_api_register_device; - new_stonith->cmds->remove_level = stonith_api_remove_level; - new_stonith->cmds->register_level = stonith_api_register_level; + new_stonith->cmds->remove_level = stonith_api_remove_level; + new_stonith->cmds->remove_level_full = stonith_api_remove_level_full; + new_stonith->cmds->register_level = stonith_api_register_level; + new_stonith->cmds->register_level_full = stonith_api_register_level_full; new_stonith->cmds->remove_callback = stonith_api_del_callback; new_stonith->cmds->register_callback = stonith_api_add_callback; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/pengine/native.c new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/pengine/native.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/pengine/native.c 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/pengine/native.c 2015-12-02 12:32:28.000000000 +0100 @@ -90,6 +90,21 @@ case recovery_block: clear_bit(rsc->flags, pe_rsc_managed); set_bit(rsc->flags, pe_rsc_block); + + /* If the group that the resource belongs to is configured with multiple-active=block, */ + /* block the whole group. */ + if (rsc->parent + && rsc->parent->variant == pe_group + && rsc->parent->recovery_type == recovery_block) { + GListPtr gIter = rsc->parent->children; + + for (; gIter != NULL; gIter = gIter->next) { + resource_t *child = (resource_t *) gIter->data; + + clear_bit(child->flags, pe_rsc_managed); + set_bit(child->flags, pe_rsc_block); + } + } break; } crm_debug("%s is active on %d nodes including %s: %s", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/lib/services/systemd.c new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/services/systemd.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/lib/services/systemd.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/lib/services/systemd.c 2015-12-02 12:32:28.000000000 +0100 @@ -420,11 +420,10 @@ " <parameters>\n" " </parameters>\n" " <actions>\n" - " <action name=\"start\" timeout=\"15\" />\n" - " <action name=\"stop\" timeout=\"15\" />\n" - " <action name=\"status\" timeout=\"15\" />\n" - " <action name=\"restart\" timeout=\"15\" />\n" - " <action name=\"monitor\" timeout=\"15\" interval=\"15\" start-delay=\"15\" />\n" + " <action name=\"start\" timeout=\"100\" />\n" + " <action name=\"stop\" timeout=\"100\" />\n" + " <action name=\"status\" timeout=\"100\" />\n" + " <action name=\"monitor\" timeout=\"100\" interval=\"60\"/>\n" " <action name=\"meta-data\" timeout=\"5\" />\n" " </actions>\n" " <special tag=\"systemd\">\n" @@ -443,7 +442,7 @@ /* ignore "already started" or "not running" errors */ if (!systemd_mask_error(op, error.name)) { - crm_err("Could not issue %s for %s: %s (%s)", op->action, op->rsc, error.message); + crm_err("Could not issue %s for %s: %s", op->action, op->rsc, error.message); } } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/mcp/pacemaker.c new/pacemaker-1.1.13+git20151201.a7d6e6b/mcp/pacemaker.c --- old/pacemaker-1.1.13+git20151111.6f22ad7/mcp/pacemaker.c 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/mcp/pacemaker.c 2015-12-02 12:32:28.000000000 +0100 @@ -699,7 +699,7 @@ continue; } else if (start_seq != pcmk_children[lpc].start_seq) { continue; - } else if (crm_pid_active(pcmk_children[lpc].pid) != 1) { + } else if (crm_pid_active(pcmk_children[lpc].pid, pcmk_children[lpc].name) != 1) { crm_notice("Process %s terminated (pid=%d)", pcmk_children[lpc].name, pcmk_children[lpc].pid); pcmk_process_exit(&(pcmk_children[lpc])); @@ -746,7 +746,7 @@ if (pcmk_children[i].flag == crm_proc_stonith_ng) { name = "stonithd"; } - if (safe_str_eq(entry_name, name) && (crm_pid_active(pid) == 1)) { + if (safe_str_eq(entry_name, name) && (crm_pid_active(pid, NULL) == 1)) { crm_notice("Tracking existing %s process (pid=%d)", name, pid); pcmk_children[i].pid = pid; pcmk_children[i].active_before_startup = TRUE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/regression.sh new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/regression.sh --- old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/regression.sh 2015-11-12 12:14:50.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/regression.sh 2015-12-02 12:32:28.000000000 +0100 @@ -226,6 +226,7 @@ do_test stop-failure-no-quorum "Stop failure without quorum" do_test stop-failure-no-fencing "Stop failure without fencing available" do_test stop-failure-with-fencing "Stop failure with fencing available" +do_test multiple-active-block-group "Support of multiple-active=block for resource groups" echo "" do_test quorum-1 "No quorum - ignore" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.dot new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.dot --- old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.dot 1970-01-01 01:00:00.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.dot 2015-12-02 12:32:28.000000000 +0100 @@ -0,0 +1,2 @@ +digraph "g" { +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.exp new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.exp --- old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.exp 1970-01-01 01:00:00.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.exp 2015-12-02 12:32:28.000000000 +0100 @@ -0,0 +1 @@ +<transition_graph cluster-delay="60s" stonith-timeout="90" failed-stop-offset="INFINITY" failed-start-offset="INFINITY" transition_id="0"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.scores new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.scores --- old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.scores 1970-01-01 01:00:00.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.scores 2015-12-02 12:32:28.000000000 +0100 @@ -0,0 +1,17 @@ +Allocation scores: +group_color: dgroup allocation score on node2: 0 +group_color: dgroup allocation score on node3: 0 +group_color: dummy allocation score on node2: 0 +group_color: dummy allocation score on node3: 0 +group_color: dummy2 allocation score on node2: 0 +group_color: dummy2 allocation score on node3: 0 +group_color: dummy3 allocation score on node2: 0 +group_color: dummy3 allocation score on node3: 0 +native_color: dummy allocation score on node2: 0 +native_color: dummy allocation score on node3: 0 +native_color: dummy2 allocation score on node2: 0 +native_color: dummy2 allocation score on node3: -INFINITY +native_color: dummy3 allocation score on node2: 0 +native_color: dummy3 allocation score on node3: -INFINITY +native_color: st-sbd allocation score on node2: 100 +native_color: st-sbd allocation score on node3: 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.summary new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.summary --- old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.summary 1970-01-01 01:00:00.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.summary 2015-12-02 12:32:28.000000000 +0100 @@ -0,0 +1,23 @@ + +Current cluster status: +Online: [ node2 node3 ] + + st-sbd (stonith:external/sbd): Started node2 + Resource Group: dgroup + dummy (ocf::heartbeat:DummyTimeout): FAILED (unmanaged)[ node2 node3 ] + dummy2 (ocf::heartbeat:Dummy): Started node2 (unmanaged) + dummy3 (ocf::heartbeat:Dummy): Started node2 (unmanaged) + +Transition Summary: + +Executing cluster transition: + +Revised cluster status: +Online: [ node2 node3 ] + + st-sbd (stonith:external/sbd): Started node2 + Resource Group: dgroup + dummy (ocf::heartbeat:DummyTimeout): FAILED (unmanaged)[ node2 node3 ] + dummy2 (ocf::heartbeat:Dummy): Started node2 (unmanaged) + dummy3 (ocf::heartbeat:Dummy): Started node2 (unmanaged) + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.xml new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.xml --- old/pacemaker-1.1.13+git20151111.6f22ad7/pengine/test10/multiple-active-block-group.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/pengine/test10/multiple-active-block-group.xml 2015-12-02 12:32:28.000000000 +0100 @@ -0,0 +1,132 @@ +<cib epoch="631" num_updates="25" admin_epoch="0" validate-with="pacemaker-1.2" crm_feature_set="3.0.8" have-quorum="1" cib-last-written="Thu Aug 20 11:44:27 2015" update-origin="node2" update-client="cibadmin" update-user="root" dc-uuid="node2"> + <configuration> + <crm_config> + <cluster_property_set id="cib-bootstrap-options"> + <nvpair name="dc-version" value="1.1.11-3ca8c3b" id="cib-bootstrap-options-dc-version"/> + <nvpair name="cluster-infrastructure" value="classic openais (with plugin)" id="cib-bootstrap-options-cluster-infrastructure"/> + <nvpair name="node-action-limit" value="2" id="cib-bootstrap-options-node-action-limit"/> + <nvpair name="expected-quorum-votes" value="2" id="cib-bootstrap-options-expected-quorum-votes"/> + <nvpair name="no-quorum-policy" value="ignore" id="cib-bootstrap-options-no-quorum-policy"/> + <nvpair name="stonith-enabled" value="false" id="cib-bootstrap-options-stonith-enabled"/> + <nvpair name="stonith-timeout" value="90" id="cib-bootstrap-options-stonith-timeout"/> + <nvpair name="last-lrm-refresh" value="1439556204" id="cib-bootstrap-options-last-lrm-refresh"/> + </cluster_property_set> + </crm_config> + <nodes> + <node uname="node2" id="node2"> + <instance_attributes id="nodes-node2"> + <nvpair id="nodes-node2-standby" name="standby" value="off"/> + </instance_attributes> + </node> + <node id="node3" uname="node3"> + <instance_attributes id="nodes-node3"> + <nvpair id="nodes-node3-standby" name="standby" value="off"/> + </instance_attributes> + </node> + </nodes> + <resources> + <primitive id="st-sbd" class="stonith" type="external/sbd"/> + <group id="dgroup"> + <meta_attributes id="dgroup-meta_attributes"> + <nvpair name="multiple-active" value="block" id="dgroup-meta_attributes-multiple-active"/> + </meta_attributes> + <primitive id="dummy" class="ocf" provider="heartbeat" type="DummyTimeout"> + <operations> + <op name="monitor" interval="10s" timeout="20" id="dummy-monitor-10s"/> + <op name="start" timeout="300s" interval="0" id="dummy-start-0"/> + <op name="stop" timeout="20s" interval="0" id="dummy-stop-0"/> + </operations> + <meta_attributes id="dummy-meta_attributes"> + <nvpair name="target-role" value="Started" id="dummy-meta_attributes-target-role"/> + </meta_attributes> + </primitive> + <primitive id="dummy2" class="ocf" provider="heartbeat" type="Dummy"> + <operations> + <op name="monitor" interval="10s" timeout="20" id="dummy2-monitor-10s"/> + <op name="start" timeout="20s" interval="0" id="dummy2-start-0"/> + <op name="stop" timeout="20s" interval="0" id="dummy2-stop-0"/> + </operations> + <meta_attributes id="dummy2-meta_attributes"> + <nvpair name="target-role" value="Started" id="dummy2-meta_attributes-target-role"/> + </meta_attributes> + </primitive> + <primitive id="dummy3" class="ocf" provider="heartbeat" type="Dummy"> + <operations> + <op name="monitor" interval="10s" timeout="20" id="dummy3-monitor-10s"/> + <op name="start" timeout="20s" interval="0" id="dummy3-start-0"/> + <op name="stop" timeout="20s" interval="0" id="dummy3-stop-0"/> + </operations> + <meta_attributes id="dummy3-meta_attributes"> + <nvpair name="target-role" value="Started" id="dummy3-meta_attributes-target-role"/> + </meta_attributes> + </primitive> + </group> + </resources> + <constraints/> + <op_defaults> + <meta_attributes id="op_defaults-options"> + <nvpair id="op_defaults-options-record-pending" name="record-pending" value="false"/> + </meta_attributes> + </op_defaults> + <rsc_defaults> + <meta_attributes id="rsc_defaults-options"> + <nvpair name="resource-stickiness" value="100" id="rsc_defaults-options-resource-stickiness"/> + <nvpair name="migration-threshold" value="100" id="rsc_defaults-options-migration-threshold"/> + </meta_attributes> + </rsc_defaults> + </configuration> + <status> + <node_state id="node2" uname="node2" in_ccm="true" crmd="online" crm-debug-origin="do_update_resource" join="member" expected="member"> + <transient_attributes id="node2"> + <instance_attributes id="status-node2"> + <nvpair id="status-node2-shutdown" name="shutdown" value="0"/> + <nvpair id="status-node2-probe_complete" name="probe_complete" value="true"/> + </instance_attributes> + </transient_attributes> + <lrm id="node2"> + <lrm_resources> + <lrm_resource id="dummy3" type="Dummy" class="ocf" provider="heartbeat"> + <lrm_rsc_op id="dummy3_last_0" operation_key="dummy3_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="13:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;13:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="24" rc-code="0" op-status="0" interval="0" last-run="1440063239" last-rc-change="1440063239" exec-time="6" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + <lrm_rsc_op id="dummy3_monitor_10000" operation_key="dummy3_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="14:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;14:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="25" rc-code="0" op-status="0" interval="10000" last-rc-change="1440063239" exec-time="5" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/> + </lrm_resource> + <lrm_resource id="st-sbd" type="external/sbd" class="stonith"> + <lrm_rsc_op id="st-sbd_last_0" operation_key="st-sbd_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.8" transition-key="10:6:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;10:6:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="27" rc-code="0" op-status="0" interval="0" last-run="1440064019" last-rc-change="1440064019" exec-time="1213" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + </lrm_resource> + <lrm_resource id="dummy" type="DummyTimeout" class="ocf" provider="heartbeat"> + <lrm_rsc_op id="dummy_last_0" operation_key="dummy_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="9:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;9:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="20" rc-code="0" op-status="0" interval="0" last-run="1440063237" last-rc-change="1440063237" exec-time="1009" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + <lrm_rsc_op id="dummy_monitor_10000" operation_key="dummy_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="10:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;10:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="21" rc-code="0" op-status="0" interval="10000" last-rc-change="1440063238" exec-time="1010" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/> + </lrm_resource> + <lrm_resource id="dummy2" type="Dummy" class="ocf" provider="heartbeat"> + <lrm_rsc_op id="dummy2_last_0" operation_key="dummy2_start_0" operation="start" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="11:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;11:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="22" rc-code="0" op-status="0" interval="0" last-run="1440063239" last-rc-change="1440063239" exec-time="5" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + <lrm_rsc_op id="dummy2_monitor_10000" operation_key="dummy2_monitor_10000" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="12:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;12:1:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="23" rc-code="0" op-status="0" interval="10000" last-rc-change="1440063239" exec-time="5" queue-time="0" op-digest="4811cef7f7f94e3a35a70be7916cb2fd"/> + </lrm_resource> + </lrm_resources> + </lrm> + </node_state> + <node_state id="node3" uname="node3" crmd="online" crm-debug-origin="do_update_resource" in_ccm="true" join="member" expected="member"> + <transient_attributes id="node3"> + <instance_attributes id="status-node3"> + <nvpair id="status-node3-shutdown" name="shutdown" value="0"/> + <nvpair id="status-node3-probe_complete" name="probe_complete" value="true"/> + </instance_attributes> + </transient_attributes> + <lrm id="node3"> + <lrm_resources> + <lrm_resource id="dummy3" type="Dummy" class="ocf" provider="heartbeat"> + <lrm_rsc_op id="dummy3_last_0" operation_key="dummy3_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="11:2:7:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:7;11:2:7:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="18" rc-code="7" op-status="0" interval="0" last-run="1440063820" last-rc-change="1440063820" exec-time="7" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + </lrm_resource> + <lrm_resource id="st-sbd" type="external/sbd" class="stonith"> + <lrm_rsc_op id="st-sbd_last_0" operation_key="st-sbd_stop_0" operation="stop" crm-debug-origin="do_update_resource" crm_feature_set="3.0.8" transition-key="9:6:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:0;9:6:0:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="21" rc-code="0" op-status="0" interval="0" last-run="1440064019" last-rc-change="1440064019" exec-time="1" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + </lrm_resource> + <lrm_resource id="dummy" type="DummyTimeout" class="ocf" provider="heartbeat"> + <lrm_rsc_op id="dummy_last_0" operation_key="dummy_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.8" transition-key="5:0:0:a5e85e43-f35a-4f75-8e15-f0ddc8d81812" transition-magic="0:7;5:0:0:a5e85e43-f35a-4f75-8e15-f0ddc8d81812" call-id="20" rc-code="7" op-status="0" interval="0" last-run="1440063984" last-rc-change="1440063984" exec-time="179014" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + <lrm_rsc_op id="dummy_last_failure_0" operation_key="dummy_start_0" operation="start" crm-debug-origin="do_update_resource" crm_feature_set="3.0.8" transition-key="5:0:0:a5e85e43-f35a-4f75-8e15-f0ddc8d81812" transition-magic="0:7;5:0:0:a5e85e43-f35a-4f75-8e15-f0ddc8d81812" call-id="20" rc-code="7" op-status="0" interval="0" last-run="1440063984" last-rc-change="1440063984" exec-time="179014" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + </lrm_resource> + <lrm_resource id="dummy2" type="Dummy" class="ocf" provider="heartbeat"> + <lrm_rsc_op id="dummy2_last_0" operation_key="dummy2_monitor_0" operation="monitor" crm-debug-origin="build_active_RAs" crm_feature_set="3.0.8" transition-key="10:2:7:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" transition-magic="0:7;10:2:7:b78eae54-472e-4e90-a3c5-ec4b25a6d8cf" call-id="14" rc-code="7" op-status="0" interval="0" last-run="1440063820" last-rc-change="1440063820" exec-time="11" queue-time="0" op-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8" op-force-restart=" state " op-restart-digest="f2317cad3d54cec5d7d7aa7d0bf35cf8"/> + </lrm_resource> + </lrm_resources> + </lrm> + </node_state> + </status> +</cib> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pacemaker-1.1.13+git20151111.6f22ad7/tools/crm_mon.sysconfig new/pacemaker-1.1.13+git20151201.a7d6e6b/tools/crm_mon.sysconfig --- old/pacemaker-1.1.13+git20151111.6f22ad7/tools/crm_mon.sysconfig 2015-11-12 12:14:51.000000000 +0100 +++ new/pacemaker-1.1.13+git20151201.a7d6e6b/tools/crm_mon.sysconfig 2015-12-02 12:32:28.000000000 +0100 @@ -1,6 +1,6 @@ # # Example for SNMP : OPTIONS="-d -S <snmp manager address> -W -p <pid file>" -# OPTIONS="-d -S 192.168.40.2 -W -p /tmp/ClusterMon-upstart.pid" +# OPTIONS="-d -S 192.168.40.2 -W -p /var/run/ClusterMon-upstart.pid" # # Please refer to a help and a manual for the detailed option. #