From 659c126190fadaba83734a9c853591ba7c589105 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Sep 15 2015 09:22:16 +0000 Subject: import resource-agents-3.9.5-40.el7_1.9 --- diff --git a/SOURCES/bz1231032-redis-update.patch b/SOURCES/bz1231032-redis-update.patch new file mode 100644 index 0000000..03ddf4b --- /dev/null +++ b/SOURCES/bz1231032-redis-update.patch @@ -0,0 +1,121 @@ +From c982683ac8c2de64f69c5f47727242c65e00df90 Mon Sep 17 00:00:00 2001 +From: David Vossel +Date: Mon, 29 Jun 2015 13:07:14 -0500 +Subject: [PATCH 2/3] bz1231032-redis-update.patch + +--- + heartbeat/redis | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- + 1 file changed, 46 insertions(+), 5 deletions(-) + +diff --git a/heartbeat/redis b/heartbeat/redis +index 6b479b2..b63a2b9 100644 +--- a/heartbeat/redis ++++ b/heartbeat/redis +@@ -20,6 +20,7 @@ fi + + CHECK_SLAVE_STATE=0 + ++REDIS_CHECK_DUMP="/usr/bin/redis-check-dump" + REDIS_SERVER="$OCF_RESKEY_bin" + REDIS_CLIENT="$OCF_RESKEY_client_bin" + REDIS_CONFIG="$OCF_RESKEY_config" +@@ -29,6 +30,17 @@ REDIS_PIDFILE="$OCF_RESKEY_rundir/$OCF_RESKEY_pidfile_name" + REDIS_SOCKET="$OCF_RESKEY_rundir/$OCF_RESKEY_socket_name" + REDIS_REPLICATION_PORT="$OCF_RESKEY_port" + ++if ! [ -f $REDIS_CHECK_DUMP ]; then ++ REDIS_CHECK_DUMP="$(which redis-check-dump 2>/dev/null)" ++fi ++ ++if [ -f "$REDIS_CONFIG" ]; then ++ REDIS_DUMP_DIR="$(cat $REDIS_CONFIG | grep "^\s*dir\s" | awk '{ print $2 }' 2>/dev/null)" ++ REDIS_DUMP_FILE="$(cat $REDIS_CONFIG | grep "^\s*dbfilename\s" | awk '{ print $2 }' 2>/dev/null)" ++fi ++: ${REDIS_DUMP_DIR:=/var/lib/redis/} ++: ${REDIS_DUMP_FILE:=dump.rdb} ++ + function meta_data() { + cat < +@@ -289,6 +301,14 @@ function monitor() { + return $OCF_SUCCESS + } + ++function check_dump_file() ++{ ++ if ! have_binary "$REDIS_CHECK_DUMP"; then ++ return 0 ++ fi ++ $REDIS_CHECK_DUMP ${REDIS_DUMP_DIR}/${REDIS_DUMP_FILE} 2>&1 ++} ++ + function start() { + monitor + status=$? +@@ -301,6 +321,16 @@ function start() { + [[ ! -d "$REDIS_RUNDIR" ]] && mkdir -p "$REDIS_RUNDIR" + chown -R "$REDIS_USER" "$REDIS_RUNDIR" + ++ # check for 0 byte database dump file. This is an unrecoverable start ++ # condition that we can avoid by deleting the 0 byte database file. ++ if [ -f "${REDIS_DUMP_DIR}/${REDIS_DUMP_FILE}" ]; then ++ local size="$(stat --format "%s" ${REDIS_DUMP_DIR}/${REDIS_DUMP_FILE})" ++ if [ "$?" -eq "0" ] && [ "$size" -eq "0" ]; then ++ ocf_log notice "Detected 0 byte ${REDIS_DUMP_FILE}, deleting zero length file to avoid start failure." ++ rm -f ${REDIS_DUMP_DIR}/${REDIS_DUMP_FILE} ++ fi ++ fi ++ + ocf_log info "start: $REDIS_SERVER --daemonize yes --unixsocket '$REDIS_SOCKET' --pidfile '$REDIS_PIDFILE'" + output="$(su "$REDIS_USER" -s /bin/sh -c "cd '$REDIS_RUNDIR'; exec '$REDIS_SERVER' '$REDIS_CONFIG' --daemonize yes --unixsocket '$REDIS_SOCKET' --pidfile '$REDIS_PIDFILE'" 2>&1)" + +@@ -325,7 +355,8 @@ function start() { + # It's possible that the `pidof` will pick up a different redis, but in that case, the start operation will just time out + sleep 1 + else +- ocf_log err "start: Unknown error waiting for redis to start" ++ check_output="$(check_dump_file)" ++ ocf_log err "start: Unknown error waiting for redis to start. redis-check-dump output=${check_output//$'\n'/; }" + return $OCF_ERR_GENERIC + fi + done +@@ -338,7 +369,8 @@ function start() { + return $OCF_SUCCESS + fi + +- ocf_log err "start: Unknown error starting redis. output=${output//$'\n'/; }" ++ check_output="$(check_dump_file)" ++ ocf_log err "start: Unknown error starting redis. redis-server output=${output//$'\n'/; } redis-check-dump output=${check_output//$'\n'/; }" + return $status + } + +@@ -427,14 +459,23 @@ function demote() { + + redis_client slaveof "$master_host" "$master_port" + +- # wait briefly for the slave to connect to the master +- for (( c=1; c <= 20; c++ )) +- do ++ # Wait forever for the slave to connect to the master and finish the ++ # sync. Timeout is controlled by Pacemaker "op start timeout=XX". ++ # ++ # hint: redis master_link_status will only come "up" when ++ # the SYNC with the master has completed. ++ # This can take an arbitraty time (data) and should ++ # only be parametrized by the start operation timeout ++ # by the administrator, not by this resource agent code ++ while true; do ++ # Wait infinite if replication is syncing ++ # Then start/demote operation timeout determines timeout + monitor + status=$? + if (( status == OCF_SUCCESS )); then + return $OCF_SUCCESS + fi ++ + sleep 1 + done + +-- +1.8.4.2 + diff --git a/SOURCES/bz1259595-redis-client-passwd-support.patch b/SOURCES/bz1259595-redis-client-passwd-support.patch new file mode 100644 index 0000000..f450683 --- /dev/null +++ b/SOURCES/bz1259595-redis-client-passwd-support.patch @@ -0,0 +1,33 @@ +commit fe53056f225fadae184a0ab79f1f96430854812f +Author: David Vossel +Date: Thu Aug 13 14:11:30 2015 -0400 + + High: redis: use required client pass word when set + +diff --git a/heartbeat/redis b/heartbeat/redis +index e1d0795..65abb2a 100755 +--- a/heartbeat/redis ++++ b/heartbeat/redis +@@ -218,7 +218,11 @@ function set_score() + + function redis_client() { + ocf_log debug "redis_client: '$REDIS_CLIENT' -s '$REDIS_SOCKET' $@" +- "$REDIS_CLIENT" -s "$REDIS_SOCKET" "$@" | sed 's/\r//' ++ if [ -n "$clientpasswd" ]; then ++ "$REDIS_CLIENT" -s "$REDIS_SOCKET" -a "$clientpasswd" "$@" | sed 's/\r//' ++ else ++ "$REDIS_CLIENT" -s "$REDIS_SOCKET" "$@" | sed 's/\r//' ++ fi + } + + function simple_status() { +@@ -487,6 +491,9 @@ function validate() { + } + + NODENAME=$(ocf_local_nodename) ++if [ -f "$REDIS_CONFIG" ]; then ++ clientpasswd="$(cat $REDIS_CONFIG | sed -n -e 's/^\s*requirepass\s*\(.*\)\s*$/\1/p' | tail -n 1)" ++fi + + ocf_log debug "action=${1:-$__OCF_ACTION} notify_type=${OCF_RESKEY_CRM_meta_notify_type} notify_operation=${OCF_RESKEY_CRM_meta_notify_operation} master_host=${OCF_RESKEY_CRM_meta_notify_master_uname} slave_host=${OCF_RESKEY_CRM_meta_notify_slave_uname} promote_host=${OCF_RESKEY_CRM_meta_notify_promote_uname} demote_host=${OCF_RESKEY_CRM_meta_notify_demote_uname}; params: bin=${OCF_RESKEY_bin} client_bin=${OCF_RESKEY_client_bin} config=${OCF_RESKEY_config} user=${OCF_RESKEY_user} rundir=${OCF_RESKEY_rundir} port=${OCF_RESKEY_port}" + diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec index 6897a29..0533a42 100644 --- a/SPECS/resource-agents.spec +++ b/SPECS/resource-agents.spec @@ -32,7 +32,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 3.9.5 -Release: 40%{?dist}.6 +Release: 40%{?dist}.9 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel} @@ -104,6 +104,8 @@ Patch59: bz1189187-redis-agent.patch Patch60: NovaCompute.patch Patch61: bz1214360-NovaCompute-update1.patch Patch62: bz1170376-galera-no-readonly.patch +Patch63: bz1231032-redis-update.patch +Patch64: bz1259595-redis-client-passwd-support.patch Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} @@ -254,6 +256,8 @@ exit 1 %patch60 -p1 %patch61 -p1 %patch62 -p1 +%patch63 -p1 +%patch64 -p1 %build if [ ! -f configure ]; then @@ -501,6 +505,20 @@ ccs_update_schema > /dev/null 2>&1 ||: %{_mandir}/man7/*SAP* %changelog +* Mon Sep 7 2015 Fabio M. Di Nitto - 3.9.5-40.9 +- Fix redis client password regexp + + Resolves: rhbz#1259595 + +* Thu Sep 3 2015 Fabio M. Di Nitto - 3.9.5-40.8 +- Add support redis client password authentication + + Resolves: rhbz#1259595 + +* Tue Aug 04 2015 David Vossel - 3.9.5-40.7 +- Fix redis failure to start when db is 0 bytes. + + Resolves: rhbz#1250073 * Mon Jul 13 2015 David Vossel - 3.9.5-40.6 - Improve galera resource-agent to not require use of read-only