diff -Nru pacemaker-1.1.10+git20130802/debian/changelog pacemaker-1.1.10+git20130802/debian/changelog --- pacemaker-1.1.10+git20130802/debian/changelog 2014-02-23 13:49:43.000000000 +0000 +++ pacemaker-1.1.10+git20130802/debian/changelog 2014-08-01 14:07:59.000000000 +0100 @@ -1,3 +1,37 @@ +pacemaker (1.1.10+git20130802-4ubuntu1) utopic; urgency=low + + [ Liam Young ] + LP: #1351307 + * Merge from Debian unstable. Remaining changes: + - debian/control: Build-Depends on libcfg-dev; Depends on libheartbeat2. + * Corosync's pacemaker plugin is disabled, hence not built: + - debian/licrmcluster4-dev.install: Do not install plugin.h. + - debian/pacemaker.install: Do not install pacemaker.lcrso. + + -- Liam Young Fri, 01 Aug 2014 13:45:08 +0100 + +pacemaker (1.1.10+git20130802-4) unstable; urgency=low + + * debian/patches/fix_crm_mon_host_list.patch: Patch by Andrew Beekhof to + finally fix crm_mon. + + -- Martin Loschwitz Tue, 06 Aug 2013 11:03:04 +0000 + +pacemaker (1.1.10+git20130802-3) unstable; urgency=low + + * Added four patches by Andrew Beekhof to make the CLI utils behave in a + rather expected way than before + * debian/patches/fix_crm_mon_utils.patch: drop + + -- Martin Loschwitz Tue, 06 Aug 2013 05:08:48 +0000 + +pacemaker (1.1.10+git20130802-2) unstable; urgency=low + + * debian/patches/fix_crm_mon_utils.patch: Patch by Andrew Beekhof to + fix crm_mon + + -- Martin Loschwitz Mon, 05 Aug 2013 12:55:31 +0000 + pacemaker (1.1.10+git20130802-1ubuntu2) trusty; urgency=medium * Rebuild to drop files installed into /usr/share/pyshared. @@ -1067,3 +1101,4 @@ Local variables: mode: debian-changelog End: + diff -Nru pacemaker-1.1.10+git20130802/debian/patches/cli_stop_after_assertion_failure.patch pacemaker-1.1.10+git20130802/debian/patches/cli_stop_after_assertion_failure.patch --- pacemaker-1.1.10+git20130802/debian/patches/cli_stop_after_assertion_failure.patch 1970-01-01 01:00:00.000000000 +0100 +++ pacemaker-1.1.10+git20130802/debian/patches/cli_stop_after_assertion_failure.patch 2013-08-06 06:07:29.000000000 +0100 @@ -0,0 +1,88 @@ +diff --git a/lib/common/logging.c b/lib/common/logging.c +index 2b74d3f..ba137f5 100644 +--- a/lib/common/logging.c ++++ b/lib/common/logging.c +@@ -46,6 +46,7 @@ + unsigned int crm_log_level = LOG_INFO; + static gboolean crm_tracing_enabled(void); + unsigned int crm_trace_nonlog = 0; ++bool crm_is_daemon = 0; + + #ifdef HAVE_G_LOG_SET_DEFAULT_HANDLER + GLogFunc glib_log_default; +@@ -626,6 +627,8 @@ + const char *facility = daemon_option("logfacility"); + const char *f_copy = facility; + ++ crm_is_daemon = daemon; ++ + if (crm_trace_nonlog == 0) { + crm_trace_nonlog = g_quark_from_static_string("Pacemaker non-logging tracepoint"); + } +@@ -711,11 +714,11 @@ + qb_log_ctl(QB_LOG_SYSLOG, QB_LOG_CONF_ENABLED, QB_FALSE); + } + +- if (daemon) { ++ if (crm_is_daemon) { + set_daemon_option("logfacility", facility); + } + +- if (daemon && crm_tracing_enabled() ++ if (crm_is_daemon && crm_tracing_enabled() + && qb_log_ctl(QB_LOG_STDERR, QB_LOG_CONF_STATE_GET, 0) != QB_LOG_STATE_ENABLED + && qb_log_ctl(QB_LOG_BLACKBOX, QB_LOG_CONF_STATE_GET, 0) != QB_LOG_STATE_ENABLED) { + /* Make sure tracing goes somewhere */ +@@ -725,20 +728,20 @@ + crm_update_callsites(); + + /* Ok, now we can start logging... */ +- if (quiet == FALSE && daemon == FALSE) { ++ if (quiet == FALSE && crm_is_daemon == FALSE) { + crm_log_args(argc, argv); + } + +- if (daemon) { ++ if (crm_is_daemon) { + const char *user = getenv("USER"); + + if (user != NULL && safe_str_neq(user, "root") && safe_str_neq(user, CRM_DAEMON_USER)) { + crm_trace("Not switching to corefile directory for %s", user); +- daemon = FALSE; ++ crm_is_daemon = FALSE; + } + } + +- if (daemon) { ++ if (crm_is_daemon) { + int user = getuid(); + const char *base = CRM_CORE_DIR; + struct passwd *pwent = getpwuid(user); +diff --git a/lib/common/utils.c b/lib/common/utils.c +index 069b5c8..527c9e0 100644 +--- a/lib/common/utils.c ++++ b/lib/common/utils.c +@@ -1085,6 +1085,8 @@ + } + } + ++extern bool crm_is_daemon; ++ + /* coverity[+kill] */ + void + crm_abort(const char *file, const char *function, int line, +@@ -1097,6 +1099,14 @@ + /* Implied by the parent's error logging below */ + /* crm_write_blackbox(0); */ + ++ if(crm_is_daemon == FALSE) { ++ /* This is a command line tool - do not fork */ ++ ++ /* crm_add_logfile(NULL); * Record it to a file? */ ++ crm_enable_stderr(TRUE); /* Make sure stderr is enabled so we can tell the caller */ ++ do_fork = FALSE; /* Just crash if needed */ ++ } ++ + if (do_core == FALSE) { + crm_err("%s: Triggered assert at %s:%d : %s", function, file, line, assert_condition); + return; diff -Nru pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_host_list.patch pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_host_list.patch --- pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_host_list.patch 1970-01-01 01:00:00.000000000 +0100 +++ pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_host_list.patch 2013-08-06 12:02:39.000000000 +0100 @@ -0,0 +1,31 @@ +diff --git a/tools/crm_mon.c b/tools/crm_mon.c +index d5b34c1..4c4e962 100644 +--- a/tools/crm_mon.c ++++ b/tools/crm_mon.c +@@ -973,7 +973,6 @@ + if (safe_str_eq(type, "ping") || safe_str_eq(type, "pingd")) { + const char *name = "pingd"; + const char *multiplier = NULL; +- char **host_list = NULL; + int host_list_num = 0; + int expected_score = 0; + +@@ -984,11 +983,15 @@ + /* To identify the resource with the attribute name. */ + if (safe_str_eq(name, attrname)) { + int value = crm_parse_int(attrvalue, "0"); ++ const char *hosts = g_hash_table_lookup(rsc->parameters, "host_list"); + + multiplier = g_hash_table_lookup(rsc->parameters, "multiplier"); +- host_list = g_strsplit(g_hash_table_lookup(rsc->parameters, "host_list"), " ", 0); +- host_list_num = g_strv_length(host_list); +- g_strfreev(host_list); ++ if(hosts) { ++ char **host_list = g_strsplit(hosts, " ", 0); ++ host_list_num = g_strv_length(host_list); ++ g_strfreev(host_list); ++ } ++ + /* pingd multiplier is the same as the default value. */ + expected_score = host_list_num * crm_parse_int(multiplier, "1"); + diff -Nru pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_utils.patch pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_utils.patch --- pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_utils.patch 1970-01-01 01:00:00.000000000 +0100 +++ pacemaker-1.1.10+git20130802/debian/patches/fix_crm_mon_utils.patch 2013-08-05 13:55:06.000000000 +0100 @@ -0,0 +1,33 @@ +diff --git a/lib/common/utils.c b/lib/common/utils.c +index 069b5c8..4c40604 100644 +--- a/lib/common/utils.c ++++ b/lib/common/utils.c +@@ -1123,13 +1123,23 @@ crm_abort(const char *file, const char *function, int line, + function, pid, file, line, assert_condition); + crm_write_blackbox(SIGTRAP, NULL); + +- do { ++ while(1) { + rc = waitpid(pid, &status, 0); +- if (rc < 0 && errno != EINTR) { +- crm_perror(LOG_ERR, "%s: Cannot wait on forked child %d", function, pid); +- } ++ if(rc == pid) { ++ break; ++ ++ } else if (errno == EINTR) { ++ crm_trace("Trying again to wait for forked child %d", pid); ++ continue; ++ ++ } else if (errno == ECHILD) { ++ crm_warn("Cannot wait on forked child %d yet", pid); + +- } while (rc < 0 && errno == EINTR); ++ } else { ++ crm_perror(LOG_ERR, "Cannot wait on forked child %d", pid); ++ break; ++ } ++ } + + return; + } diff -Nru pacemaker-1.1.10+git20130802/debian/patches/glib_no_CRIT_messages.patch pacemaker-1.1.10+git20130802/debian/patches/glib_no_CRIT_messages.patch --- pacemaker-1.1.10+git20130802/debian/patches/glib_no_CRIT_messages.patch 1970-01-01 01:00:00.000000000 +0100 +++ pacemaker-1.1.10+git20130802/debian/patches/glib_no_CRIT_messages.patch 2013-08-06 06:07:42.000000000 +0100 @@ -0,0 +1,29 @@ +diff --git a/lib/common/logging.c b/lib/common/logging.c +index b4ca277..2b74d3f 100644 +--- a/lib/common/logging.c ++++ b/lib/common/logging.c +@@ -56,12 +56,21 @@ + { + int log_level = LOG_WARNING; + GLogLevelFlags msg_level = (flags & G_LOG_LEVEL_MASK); ++ static struct qb_log_callsite *glib_cs = NULL; ++ ++ if (glib_cs == NULL) { ++ glib_cs = qb_log_callsite_get(__PRETTY_FUNCTION__, __FILE__, "glib-handler", LOG_DEBUG, __LINE__, crm_trace_nonlog); ++ } ++ + + switch (msg_level) { + case G_LOG_LEVEL_CRITICAL: +- /* log and record how we got here */ +- crm_abort(__FILE__, __PRETTY_FUNCTION__, __LINE__, message, TRUE, TRUE); +- return; ++ log_level = LOG_CRIT; ++ ++ if (crm_is_callsite_active(glib_cs, LOG_DEBUG, 0) == FALSE) { ++ /* log and record how we got here */ ++ crm_abort(__FILE__, __PRETTY_FUNCTION__, __LINE__, message, TRUE, TRUE); ++ } + + case G_LOG_LEVEL_ERROR: + log_level = LOG_ERR; diff -Nru pacemaker-1.1.10+git20130802/debian/patches/gracefully_handle_ECHILD_in_waitpid.patch pacemaker-1.1.10+git20130802/debian/patches/gracefully_handle_ECHILD_in_waitpid.patch --- pacemaker-1.1.10+git20130802/debian/patches/gracefully_handle_ECHILD_in_waitpid.patch 1970-01-01 01:00:00.000000000 +0100 +++ pacemaker-1.1.10+git20130802/debian/patches/gracefully_handle_ECHILD_in_waitpid.patch 2013-08-06 06:08:26.000000000 +0100 @@ -0,0 +1,61 @@ +diff --git a/lib/common/utils.c b/lib/common/utils.c +index 527c9e0..b45e620 100644 +--- a/lib/common/utils.c ++++ b/lib/common/utils.c +@@ -1118,31 +1118,36 @@ + crm_err("%s: Triggered fatal assert at %s:%d : %s", function, file, line, assert_condition); + } + +- switch (pid) { +- case -1: +- crm_crit("%s: Cannot create core for non-fatal assert at %s:%d : %s", +- function, file, line, assert_condition); +- return; +- +- case 0: /* Child */ +- abort(); +- break; ++ if (pid == -1) { ++ crm_crit("%s: Cannot create core for non-fatal assert at %s:%d : %s", ++ function, file, line, assert_condition); ++ return; ++ ++ } else if(pid == 0) { ++ /* Child process */ ++ abort(); ++ return; ++ } + +- default: /* Parent */ +- crm_err("%s: Forked child %d to record non-fatal assert at %s:%d : %s", +- function, pid, file, line, assert_condition); +- crm_write_blackbox(SIGTRAP, NULL); ++ /* Parent process */ ++ crm_err("%s: Forked child %d to record non-fatal assert at %s:%d : %s", ++ function, pid, file, line, assert_condition); ++ crm_write_blackbox(SIGTRAP, NULL); + +- do { +- rc = waitpid(pid, &status, 0); +- if (rc < 0 && errno != EINTR) { +- crm_perror(LOG_ERR, "%s: Cannot wait on forked child %d", function, pid); +- } ++ do { ++ rc = waitpid(pid, &status, 0); ++ if(rc == pid) { ++ return; /* Job done */ ++ } + +- } while (rc < 0 && errno == EINTR); ++ } while(errno == EINTR); + +- return; ++ if (errno == ECHILD) { ++ /* crm_mon does this */ ++ crm_trace("Cannot wait on forked child %d - SIGCHLD is probably set to SIG_IGN", pid); ++ return; + } ++ crm_perror(LOG_ERR, "Cannot wait on forked child %d", pid); + } + + char * diff -Nru pacemaker-1.1.10+git20130802/debian/patches/prevent_glib_assertion.patch pacemaker-1.1.10+git20130802/debian/patches/prevent_glib_assertion.patch --- pacemaker-1.1.10+git20130802/debian/patches/prevent_glib_assertion.patch 1970-01-01 01:00:00.000000000 +0100 +++ pacemaker-1.1.10+git20130802/debian/patches/prevent_glib_assertion.patch 2013-08-06 06:06:16.000000000 +0100 @@ -0,0 +1,16 @@ +diff --git a/lib/services/systemd.c b/lib/services/systemd.c +index 2a66da5..b18f86f 100644 +--- a/lib/services/systemd.c ++++ b/lib/services/systemd.c +@@ -478,7 +478,10 @@ struct unit_info { + fclose(file_strm); + } + systemd_daemon_reload(systemd_proxy, &error); +- g_error_free(error); error = NULL; ++ if(error) { ++ g_error_free(error); ++ error = NULL; ++ } + free(override_file); + free(override_dir); + diff -Nru pacemaker-1.1.10+git20130802/debian/patches/series pacemaker-1.1.10+git20130802/debian/patches/series --- pacemaker-1.1.10+git20130802/debian/patches/series 2013-03-21 09:00:20.000000000 +0000 +++ pacemaker-1.1.10+git20130802/debian/patches/series 2014-02-23 17:10:26.000000000 +0000 @@ -1,2 +1,7 @@ raexecupstart.patch default_file_for_pacemaker.patch +prevent_glib_assertion.patch +glib_no_CRIT_messages.patch +cli_stop_after_assertion_failure.patch +gracefully_handle_ECHILD_in_waitpid.patch +fix_crm_mon_host_list.patch diff -Nru pacemaker-1.1.10+git20130802/debian/rules pacemaker-1.1.10+git20130802/debian/rules --- pacemaker-1.1.10+git20130802/debian/rules 2013-08-02 07:41:11.000000000 +0100 +++ pacemaker-1.1.10+git20130802/debian/rules 2014-02-23 17:10:26.000000000 +0000 @@ -148,6 +148,7 @@ # create special directory mkdir -p `pwd`/debian/pacemaker/var/lib/pengine mkdir -p `pwd`/debian/pacemaker/var/lib/heartbeat/pengine + mkdir -p `pwd`/debian/pacemaker/var/lib/pacemaker/{blackbox,cib,cores,pengine} dh_installdebconf -a dh_installdocs -a