Hello community, here is the log from the commit of package resource-agents for openSUSE:Factory checked in at 2014-06-26 07:57:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/resource-agents (Old) and /work/SRC/openSUSE:Factory/.resource-agents.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "resource-agents" Changes: -------- --- /work/SRC/openSUSE:Factory/resource-agents/resource-agents.changes 2014-06-19 13:08:26.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.resource-agents.new/resource-agents.changes 2014-06-26 07:58:00.000000000 +0200 @@ -1,0 +2,15 @@ +Wed Jun 25 08:51:06 UTC 2014 - [email protected] + +- High: conntrackd: allow probe to return OCF_RUNNING_MASTER +- High: Filesystem: Add force_unmount option +- High: fs-lib.sh: Force kill processes with access to shared libraries on mount point +- High: VirtualDomain: restore advertised start and stop timeout values to a sane value. +- Exclude Xen resource agent (bnc#882548) +- Merged upstream: + - Removed 0001-Low-ldirectord-fix-the-list-output-to-include-ops-fl.patch + - Removed 0001-ldirectord-Add-systemd-unit-file-bnc-863250.patch +- Dropped (bnc#882548) + - Removed xen-replace-xm-with-xl.patch +- upstream cs: v3.9.5-432-g07aeed7c9035 + +------------------------------------------------------------------- Old: ---- 0001-Low-ldirectord-fix-the-list-output-to-include-ops-fl.patch 0001-ldirectord-Add-systemd-unit-file-bnc-863250.patch resource-agents-3.9.5+git410.tar.xz xen-replace-xm-with-xl.patch New: ---- resource-agents-3.9.5+git432.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ resource-agents.spec ++++++ --- /var/tmp/diff_new_pack.Yd7MAV/_old 2014-06-26 07:58:01.000000000 +0200 +++ /var/tmp/diff_new_pack.Yd7MAV/_new 2014-06-26 07:58:01.000000000 +0200 @@ -44,7 +44,7 @@ Summary: Open Source HA Reusable Cluster Resource Scripts License: GPL-2.0 and LGPL-2.1+ Group: Productivity/Clustering/HA -Version: 3.9.5+git410 +Version: 3.9.5+git432 Release: 0 Url: http://linux-ha.org/ Source: resource-agents-%{version}.tar.xz @@ -63,10 +63,6 @@ Patch10: fix-sg_persist-for-code-normalization.patch # PATCH-FIX-UPSTREAM: Require monitoring user as parameter (bnc#850589, bnc#859683), [email protected] Patch12: 0001-High-oracle-Require-monitoring-user-as-parameter-bnc.patch -# PATCH-FIX-UPSTREAM: ldirectord: Fix the list output to include ops flag (bnc#847005) -Patch13: 0001-Low-ldirectord-fix-the-list-output-to-include-ops-fl.patch -# PATCH-FEATURE-UPSTREAM: ldirectord: Add systemd unit file (bnc#863250) -Patch14: 0001-ldirectord-Add-systemd-unit-file-bnc-863250.patch # PATCH-FIX-UPSTREAM: mysql: Update mysql with more sensible defaults (bnc#863844) Patch16: 0001-Medium-mysql-Update-mysql-with-more-sensible-default.patch # PATCH-FIX-UPSTREAM: sg_persist: fix commented by Lars @@ -77,8 +73,6 @@ Patch19: fix-sg_persist-devs-required-and-not-defined.patch # sg_persist: change sg_persist ocft not configure isci and let user prepare it manually Patch20: sg_persist-ocft-not-configure-iscsi.patch -# PATCH-FIX-UPSTREAM: Replace use of xm with xl (bnc#882548), [email protected] -Patch21: xen-replace-xm-with-xl.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build Obsoletes: heartbeat-resources @@ -157,14 +151,11 @@ %patch8 -p1 %patch10 -p1 %patch12 -p1 -%patch13 -p1 -%patch14 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 -%patch21 -p1 ########################################################### %build @@ -230,6 +221,10 @@ ln -s /usr/lib/ocf/lib/heartbeat/$f done ) +# remove Xen agent (bnc#882548) +rm -f $RPM_BUILD_ROOT/usr/lib/ocf/resource.d/heartbeat/Xen +rm -f $RPM_BUILD_ROOT%{_mandir}/man7/ocf_heartbeat_Xen.7* + ########################################################### %clean ++++++ resource-agents-3.9.5+git410.tar.xz -> resource-agents-3.9.5+git432.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/configure.ac new/resource-agents-3.9.5+git432/configure.ac --- old/resource-agents-3.9.5+git410/configure.ac 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/configure.ac 2014-06-19 21:56:51.000000000 +0200 @@ -56,6 +56,26 @@ [ --with-pkg-name=name Override package name (if you're a packager needing to pretend) ], [ PACKAGE_NAME="$withval" ]) +AC_PATH_PROGS(PKGCONFIG, pkg-config) +if test x"${PKGCONFIG}" = x""; then + AC_MSG_ERROR(You need pkgconfig installed in order to build ${PACKAGE}) +fi + +AC_ARG_WITH([systemdsystemunitdir], + [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, + [with_systemdsystemunitdir=auto]) +AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ + def_systemdsystemunitdir=$($PKGCONFIG --variable=systemdsystemunitdir systemd) + + AS_IF([test "x$def_systemdsystemunitdir" = "x"], + [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], + [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) + with_systemdsystemunitdir=no], + [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) +AS_IF([test "x$with_systemdsystemunitdir" != "xno"], + [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) +AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) + dnl dnl AM_INIT_AUTOMAKE([1.11.1 foreign dist-bzip2 dist-xz]) dnl @@ -451,7 +471,6 @@ AC_PATH_PROGS(IFCONFIG, ifconfig, /sbin/ifconfig) AC_PATH_PROGS(MAILCMD, mailx mail, mail) AC_PATH_PROGS(EGREP, egrep) -AC_PATH_PROGS(PKGCONFIG, pkg-config) AC_SUBST(MAILCMD) AC_SUBST(EGREP) @@ -487,10 +506,6 @@ AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(gnugetopt, getopt_long) dnl if available -if test x"${PKGCONFIG}" = x""; then - AC_MSG_ERROR(You need pkgconfig installed in order to build ${PACKAGE}) -fi - if test "x${enable_thread_safe}" = "xyes"; then GPKGNAME="gthread-2.0" else @@ -861,6 +876,8 @@ ldirectord/init.d/ldirectord \ ldirectord/init.d/ldirectord.debian \ ldirectord/init.d/ldirectord.debian.default \ + ldirectord/systemd/Makefile \ + ldirectord/systemd/ldirectord.service \ ldirectord/logrotate.d/Makefile \ ldirectord/OCF/Makefile \ ldirectord/OCF/ldirectord \ @@ -883,7 +900,7 @@ AC_MSG_RESULT([]) AC_MSG_RESULT([$PACKAGE configuration:]) AC_MSG_RESULT([ Version = ${VERSION}]) -AC_MSG_RESULT([ Build Version = 6f1dffee54d1d537b601204ef1c90913ee820201]) +AC_MSG_RESULT([ Build Version = 07aeed7c9035d8881ee2ec035054f6cb0b53e9f4]) AC_MSG_RESULT([ Features =${PKG_FEATURES}]) AC_MSG_RESULT([]) AC_MSG_RESULT([ Prefix = ${prefix}]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/heartbeat/Filesystem new/resource-agents-3.9.5+git432/heartbeat/Filesystem --- old/resource-agents-3.9.5+git410/heartbeat/Filesystem 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/heartbeat/Filesystem 2014-06-19 21:56:51.000000000 +0200 @@ -196,6 +196,26 @@ <content type="boolean" default="false" /> </parameter> +<parameter name="force_unmount"> +<longdesc lang="en"> +This option allows specifying how to handle processes that are +currently accessing the mount directory. + +"true" : Default value, kill processes accessing mount point +"safe" : Kill processes accessing mount point using methods that + avoid functions that could potentially block during process + detection +"false" : Do not kill any processes. + +The 'safe' option uses shell logic to walk the /procs/ directory +for pids using the mount point while the default option uses the +fuser cli tool. fuser is known to perform operations that can potentially +block if unresponsive nfs mounts are in use on the system. +</longdesc> +<shortdesc lang="en">Kill processes before unmount</shortdesc> +<content type="boolean" default="true" /> +</parameter> + </parameters> <actions> @@ -400,6 +420,25 @@ } # end of Filesystem_start +get_pids() +{ + local dir=$1 + local procs + local mmap_procs + + if ocf_is_true "$FORCE_UNMOUNT"; then + if [ "X${HOSTOS}" = "XOpenBSD" ];then + fstat | grep $dir | awk '{print $3}' + else + $FUSER -m $dir 2>/dev/null + fi + elif [ "$FORCE_UNMOUNT" = "safe" ]; then + procs=$(find /proc/[0-9]*/ -type l -lname "${dir}/*" -or -lname "${dir}" 2>/dev/null | awk -F/ '{print $3}') + mmap_procs=$(grep " ${dir}" /proc/[0-9]*/maps | awk -F/ '{print $3}') + printf "${procs}\n${mmap_procs}" | sort | uniq + fi +} + signal_processes() { local dir=$1 local sig=$2 @@ -407,15 +446,9 @@ # fuser returns a non-zero return code if none of the # specified files is accessed or in case of a fatal # error. - pids=$( - if [ "X${HOSTOS}" = "XOpenBSD" ];then - fstat | grep $dir | awk '{print $3}' - else - $FUSER -m $dir 2>/dev/null - fi - ) + pids=$(get_pids "$dir") if [ -z "$pids" ]; then - ocf_log info "No processes on $dir were signalled" + ocf_log info "No processes on $dir were signalled. force_unmount is set to '$FORCE_UNMOUNT'" return fi for pid in $pids; do @@ -687,6 +720,11 @@ fi # Check the OCF_RESKEY_ environment variables... +FORCE_UNMOUNT="yes" +if [ -n "${OCF_RESKEY_force_unmount}" ]; then + FORCE_UNMOUNT=$OCF_RESKEY_force_unmount +fi + DEVICE=$OCF_RESKEY_device FSTYPE=$OCF_RESKEY_fstype if [ ! -z "$OCF_RESKEY_options" ]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/heartbeat/VirtualDomain new/resource-agents-3.9.5+git432/heartbeat/VirtualDomain --- old/resource-agents-3.9.5+git410/heartbeat/VirtualDomain 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/heartbeat/VirtualDomain 2014-06-19 21:56:51.000000000 +0200 @@ -167,8 +167,8 @@ </parameters> <actions> -<action name="start" timeout="$OCF_RESKEY_CRM_meta_timeout_default" /> -<action name="stop" timeout="$OCF_RESKEY_CRM_meta_timeout_default" /> +<action name="start" timeout="90" /> +<action name="stop" timeout="90" /> <action name="status" depth="0" timeout="30" interval="10" /> <action name="monitor" depth="0" timeout="30" interval="10" /> <action name="migrate_from" timeout="60" /> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/heartbeat/conntrackd new/resource-agents-3.9.5+git432/heartbeat/conntrackd --- old/resource-agents-3.9.5+git410/heartbeat/conntrackd 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/heartbeat/conntrackd 2014-06-19 21:56:51.000000000 +0200 @@ -284,7 +284,7 @@ EOF } -statefile=conntrackd.${OCF_RESOURCE_INSTANCE}.master +statefile=conntrackd.${OCF_RESOURCE_INSTANCE//:[0-9]*}.master master_score=1000 slave_score=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/heartbeat/db2 new/resource-agents-3.9.5+git432/heartbeat/db2 --- old/resource-agents-3.9.5+git410/heartbeat/db2 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/heartbeat/db2 2014-06-19 21:56:51.000000000 +0200 @@ -132,6 +132,9 @@ db2_validate() { local db2home db2sql db2instance + # db2 uses korn shell + check_binary "ksh" + # check required instance vars if [ -z "$OCF_RESKEY_instance" ] then @@ -208,6 +211,14 @@ return $OCF_SUCCESS } +master_score() +{ + if ! have_binary "crm_master"; then + return + fi + + crm_master $* +} # # Run the given command as db2 instance user @@ -380,8 +391,17 @@ # db2_start() { local output start_cmd db + local start_opts="dbpartitionnum $db2node" - if output=$(runasdb2 db2start dbpartitionnum $db2node) + # If we detect that db partitions are not in use, and no + # partition is explicitly specified, activate without + # partition information. This allows db2 instances without + # partition support to be managed. + if [ -z "$OCF_RESKEY_dbpartitionnum" ] && ! [ -a "$db2sql/db2nodes.cfg" ]; then + start_opts="" + fi + + if output=$(runasdb2 db2start $start_opts) then ocf_log info "DB2 instance $instance($db2node) started: $output" else @@ -473,10 +493,15 @@ # db2_stop_bg() { local rc output + local stop_opts="dbpartitionnum $db2node" rc=$OCF_SUCCESS - if output=$(runasdb2 db2stop force dbpartitionnum $db2node) + if [ -z "$OCF_RESKEY_dbpartitionnum" ] && ! [ -a "$db2sql/db2nodes.cfg" ]; then + stop_opts="" + fi + + if output=$(runasdb2 db2stop force $stop_opts) then ocf_log info "DB2 instance $instance($db2node) stopped: $output" else @@ -502,13 +527,13 @@ local stop_timeout grace_timeout stop_bg_pid i must_kill # remove master score - crm_master -D -l reboot + master_score -D -l reboot # be very early here in order to avoid stale data rm -f $STATE_FILE - if ! db2_instance_status - then + db2_instance_status + if [ $? -eq $OCF_NOT_RUNNING ]; then ocf_log info "DB2 instance $instance already stopped" return $OCF_SUCCESS fi @@ -585,7 +610,12 @@ local pscount pscount=$(runasdb2 $db2bin/db2nps $db2node | cut -c9- | grep ' db2[^ ]' | wc -l) - test $pscount -ge 4 + if [ $pscount -ge 4 ]; then + return $OCF_SUCCESS; + elif [ $pscount -ge 1 ]; then + return $OCF_GENERIC_ERR + fi + return $OCF_NOT_RUNNING } # @@ -626,12 +656,14 @@ # db2_monitor() { local CMD output hadr db + local rc - if ! db2_instance_status - then + db2_instance_status + rc=$? + if [ $rc -ne $OCF_SUCCESS ]; then # instance is dead remove master score - crm_master -D -l reboot - exit $OCF_NOT_RUNNING + master_score -D -l reboot + exit $rc fi [ $db2node = 0 ] || return 0 @@ -667,22 +699,22 @@ ocf_log err "DB2 message: $output" # dead primary, remove master score - crm_master -D -l reboot + master_score -D -l reboot return $OCF_ERR_GENERIC esac fi ocf_log debug "DB2 database $instance($db2node)/$db appears to be working" - ocf_is_ms && crm_master -v 10000 -l reboot + ocf_is_ms && master_score -v 10000 -l reboot ;; Standby/*Peer) - crm_master -v 8000 -l reboot + master_score -v 8000 -l reboot ;; Standby/*) ocf_log warn "DB2 database $instance($db2node)/$db in status $hadr can never be promoted" - crm_master -D -l reboot + master_score -D -l reboot ;; *) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/heartbeat/ocf-shellfuncs.in new/resource-agents-3.9.5+git432/heartbeat/ocf-shellfuncs.in --- old/resource-agents-3.9.5+git410/heartbeat/ocf-shellfuncs.in 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/heartbeat/ocf-shellfuncs.in 2014-06-19 21:56:51.000000000 +0200 @@ -22,7 +22,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# Build version: 6f1dffee54d1d537b601204ef1c90913ee820201 +# Build version: 07aeed7c9035d8881ee2ec035054f6cb0b53e9f4 # TODO: Some of this should probably split out into a generic OCF # library for shell scripts, but for the time being, we'll just use it diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/heartbeat/rsyncd new/resource-agents-3.9.5+git432/heartbeat/rsyncd --- old/resource-agents-3.9.5+git410/heartbeat/rsyncd 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/heartbeat/rsyncd 2014-06-19 21:56:51.000000000 +0200 @@ -164,7 +164,7 @@ if grep -v "^#" "$CONF_FILE" | grep "pid file" > /dev/null ; then $COMMAND; if [ $? -ne 0 ]; then - ocf_log err "Error. rsycn daemon returned error $?." + ocf_log err "Error. rsync daemon returned error $?." exit $OCF_ERR_GENERIC fi else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/ldirectord/Makefile.am new/resource-agents-3.9.5+git432/ldirectord/Makefile.am --- old/resource-agents-3.9.5+git410/ldirectord/Makefile.am 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/ldirectord/Makefile.am 2014-06-19 21:56:51.000000000 +0200 @@ -22,7 +22,7 @@ EXTRA_DIST = ldirectord ldirectord.cf -SUBDIRS = logrotate.d init.d OCF +SUBDIRS = logrotate.d init.d OCF systemd ldirectord.8: ldirectord $(POD2MAN) --section=8 $< > $@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/ldirectord/ldirectord.in new/resource-agents-3.9.5+git432/ldirectord/ldirectord.in --- old/resource-agents-3.9.5+git410/ldirectord/ldirectord.in 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/ldirectord/ldirectord.in 2014-06-19 21:56:51.000000000 +0200 @@ -700,6 +700,13 @@ Default: no separate logging of service checks. +B<ops = >B<yes> | B<no> + +Specify that a virtual service uses one-packet scheduling. This option +can be used only for UDP services. If this option is specified, all connections +are created only to schedule one packet. Option is useful to schedule +UDP packets from same client port to different real servers. + =head1 IPv6 Directives for IPv6 are virtual6, real6, fallback6. @@ -1364,6 +1371,7 @@ $vsrv{num_connects} = 0; $vsrv{httpmethod} = "GET"; $vsrv{secret} = ""; + $vsrv{ops} = "no"; push(@VIRTUAL, \%vsrv); while(<CFGFILE>) { $line++; @@ -1497,6 +1505,12 @@ } else { &config_error($line, "invalid protocol"); } + } elsif ($rcmd =~ /^ops\s*=\s*(.*)/) { + if ($1 eq "yes" || $1 eq "no") { + $vsrv{ops} = $1; + } else { + &config_error($line, "ops must be 'yes' or 'no'"); + } } elsif ($rcmd =~ /^service\s*=\s*(.*)/) { $1 =~ /(\w+)/ && ($1 eq "dns" || $1 eq "ftp" || @@ -2239,6 +2253,9 @@ $$v{proto} = "-f"; } $$v{flags} = "$$v{proto} " . &get_virtual_option($v) . " "; + if ($$v{protocol} eq "udp" && $$v{ops} eq "yes") { + $$v{flags} .= "-o "; + } $$v{flags} .= "-s $$v{scheduler} " if defined ($$v{scheduler}); if (defined $$v{persistent}) { $$v{flags} .= "-p $$v{persistent} "; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/ldirectord/systemd/Makefile.am new/resource-agents-3.9.5+git432/ldirectord/systemd/Makefile.am --- old/resource-agents-3.9.5+git410/ldirectord/systemd/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ new/resource-agents-3.9.5+git432/ldirectord/systemd/Makefile.am 2014-06-19 21:56:51.000000000 +0200 @@ -0,0 +1,24 @@ +# +# ldirectord: Linux-HA heartbeat code +# +# Copyright (C) 2001 Michael Moerz +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +MAINTAINERCLEANFILES = Makefile.in + +if HAVE_SYSTEMD +systemdsystemunit_DATA = ldirectord.service +endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/ldirectord/systemd/ldirectord.service.in new/resource-agents-3.9.5+git432/ldirectord/systemd/ldirectord.service.in --- old/resource-agents-3.9.5+git410/ldirectord/systemd/ldirectord.service.in 1970-01-01 01:00:00.000000000 +0100 +++ new/resource-agents-3.9.5+git432/ldirectord/systemd/ldirectord.service.in 2014-06-19 21:56:51.000000000 +0200 @@ -0,0 +1,11 @@ +[Unit] +Description=Monitor and administer real servers in a LVS cluster of load balanced virtual servers + +[Service] +ExecStart=@sbindir@/ldirectord start +ExecStartPost=/usr/bin/touch /var/lock/subsys/ldirectord +ExecStop=@sbindir@/ldirectord stop +ExecStopPost=/usr/bin/rm -f /var/lock/subsys/ldirectord +ExecReload=@sbindir@/ldirectord reload +PIDFile=/var/run/ldirectord.ldirectord.pid +Type=forking diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/resource-agents.spec.in new/resource-agents-3.9.5+git432/resource-agents.spec.in --- old/resource-agents-3.9.5+git410/resource-agents.spec.in 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/resource-agents.spec.in 2014-06-19 21:56:51.000000000 +0200 @@ -126,6 +126,10 @@ Requires(post): /sbin/chkconfig Requires(preun):/sbin/chkconfig %endif +%if %{defined systemd_requires} +BuildRequires: systemd +%{?systemd_requires} +%endif %description -n ldirectord The Linux Director Daemon (ldirectord) was written by Jacob Rief. @@ -174,6 +178,9 @@ %configure \ %{?conf_opt_rsctmpdir:%conf_opt_rsctmpdir} \ %{conf_opt_fatal} \ +%if %{defined _unitdir} + --with-systemdsystemunitdir=%{_unitdir} \ +%endif --with-pkg-name=%{name} \ --with-ras-set=%{rasset} @@ -198,7 +205,11 @@ test -d %{buildroot}/sbin || mkdir %{buildroot}/sbin ( cd %{buildroot}/sbin - ln -sf /%{_sysconfdir}/init.d/ldirectord rcldirectord +%if %{defined _unitdir} + ln -s /usr/sbin/service rcldirectord +%else + ln -sf /%{_sysconfdir}/init.d/ldirectord rcldirectord +%endif ) || true %endif %endif @@ -270,10 +281,26 @@ %if 0%{?suse_version} %preun -n ldirectord +%if %{defined _unitdir} +%service_del_preun ldirectord.service +%else %stop_on_removal ldirectord +%endif %postun -n ldirectord +%if %{defined _unitdir} +%service_del_postun ldirectord.service +%else %insserv_cleanup %endif +%post -n ldirectord +%if %{defined _unitdir} +%service_add_post ldirectord.service +%endif +%pre -n ldirectord +%if %{defined _unitdir} +%service_add_pre ldirectord.service +%endif +%endif %if 0%{?fedora} %preun -n ldirectord @@ -292,7 +319,12 @@ %dir %{_sysconfdir}/ha.d %dir %{_sysconfdir}/ha.d/resource.d %{_sysconfdir}/ha.d/resource.d/ldirectord +%if %{defined _unitdir} +%{_unitdir}/ldirectord.service +%exclude %{_sysconfdir}/init.d/ldirectord +%else %{_sysconfdir}/init.d/ldirectord +%endif %if 0%{?suse_version} /sbin/rcldirectord %endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/rgmanager/src/resources/Makefile.am new/resource-agents-3.9.5+git432/rgmanager/src/resources/Makefile.am --- old/resource-agents-3.9.5+git410/rgmanager/src/resources/Makefile.am 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/rgmanager/src/resources/Makefile.am 2014-06-19 21:56:51.000000000 +0200 @@ -26,7 +26,7 @@ script.sh netfs.sh clusterfs.sh smb.sh \ apache.sh openldap.sh samba.sh mysql.sh \ postgres-8.sh tomcat-5.sh lvm.sh \ - vm.sh SAPInstance SAPDatabase named.sh \ + vm.sh SAPInstance SAPDatabase named.sh db2.sh \ ASEHAagent.sh drbd.sh nfsserver.sh \ tomcat-6.sh orainstance.sh oralistener.sh oracledb.sh \ bind-mount.sh diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/rgmanager/src/resources/db2.sh new/resource-agents-3.9.5+git432/rgmanager/src/resources/db2.sh --- old/resource-agents-3.9.5+git410/rgmanager/src/resources/db2.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/resource-agents-3.9.5+git432/rgmanager/src/resources/db2.sh 2014-06-19 21:56:51.000000000 +0200 @@ -0,0 +1,133 @@ +#!/bin/bash +# +# Copyright (c) 2011 Holger Teutsch <[email protected]> +# Copyright (c) 2014 David Vossel <[email protected]> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +# NOTE: +# +# This agent is a wrapper around the heartbeat/db2 agent which limits the heartbeat +# db2 agent to Standard role support. This allows cluster managers such as rgmanager +# which do not have multi-state resource support to manage db2 instances with +# a limited feature set. +# + +export LC_ALL=C +export LANG=C +export PATH=/bin:/sbin:/usr/bin:/usr/sbin +. $(dirname $0)/ocf-shellfuncs + +meta_data() { +cat <<END +<?xml version="1.0"?> +<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"> +<resource-agent name="db2.sh"> +<version>1.0</version> +<longdesc lang="en"> +Resource Agent that manages an IBM DB2 LUW databases in Standard role. Multiple partitions are supported. + +When partitions are in use, each partition must be configured as a separate primitive resource. + +</longdesc> +<shortdesc lang="en">Resource Agent that manages an IBM DB2 LUW databases in Standard role with multiple partition support.</shortdesc> + +<parameters> +<parameter name="instance" unique="1" required="1"> +<longdesc lang="en"> +The instance of the database(s). +</longdesc> +<shortdesc lang="en">instance</shortdesc> +<content type="string" default="" /> +</parameter> +<parameter name="dblist" unique="0" required="0"> +<longdesc lang="en"> +List of databases to be managed, e.g "db1 db2". +Defaults to all databases in the instance. +</longdesc> +<shortdesc lang="en">List of databases to be managed</shortdesc> +<content type="string"/> +</parameter> +<parameter name="dbpartitionnum" unique="0" required="0"> +<longdesc lang="en"> +The number of the partion (DBPARTITIONNUM) to be managed. +</longdesc> +<shortdesc lang="en">database partition number (DBPARTITIONNUM)</shortdesc> +<content type="string" default="0" /> +</parameter> +</parameters> + +<actions> +<action name="start" timeout="120"/> +<action name="stop" timeout="120"/> +<action name="monitor" depth="0" timeout="60" interval="20"/> +<action name="monitor" depth="0" timeout="60" role="Master" interval="22"/> +<action name="validate-all" timeout="5"/> +<action name="meta-data" timeout="5"/> +</actions> +</resource-agent> +END +} + +heartbeat_db2_wrapper() +{ + # default heartbeat agent ocf root. + export OCF_ROOT=/usr/lib/ocf + heartbeat_db2="${OCF_ROOT}/resource.d/heartbeat/db2" + + if ! [ -a $heartbeat_db2 ]; then + echo "heartbeat db2 agent not found at '${heartbeat_db2}'" + exit $OCF_ERR_INSTALLED + fi + + $heartbeat_db2 $1 +} + +case $1 in + meta-data) + meta_data + exit 0 + ;; + validate-all) + heartbeat_db2_wrapper $1 + exit $? + ;; + start) + heartbeat_db2_wrapper $1 + exit $? + ;; + stop) + heartbeat_db2_wrapper $1 + exit $? + ;; + status|monitor) + heartbeat_db2_wrapper "monitor" + exit $? + ;; + restart) + heartbeat_db2_wrapper "stop" + rc=$? + if [ $rc -ne 0 ]; then + exit $rc + fi + heartbeat_db2_wrapper "start" + exit $? + ;; + *) + echo "Usage: db2.sh {start|stop|monitor|validate-all|meta-data}" + exit $OCF_ERR_UNIMPLEMENTED + ;; +esac diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/rgmanager/src/resources/nfsserver.sh new/resource-agents-3.9.5+git432/rgmanager/src/resources/nfsserver.sh --- old/resource-agents-3.9.5+git410/rgmanager/src/resources/nfsserver.sh 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/rgmanager/src/resources/nfsserver.sh 2014-06-19 21:56:51.000000000 +0200 @@ -462,12 +462,12 @@ # sm-notify can prevent umount of /var/lib/nfs/statd if # it is still trying to notify unresponsive clients. stop_process sm-notify - if [ $? -ne 0]; then + if [ $? -ne 0 ]; then ret=1 fi stop_process rpc.statd - if [ $? -ne 0]; then + if [ $? -ne 0 ]; then ret=1 fi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/resource-agents-3.9.5+git410/rgmanager/src/resources/utils/fs-lib.sh new/resource-agents-3.9.5+git432/rgmanager/src/resources/utils/fs-lib.sh --- old/resource-agents-3.9.5+git410/rgmanager/src/resources/utils/fs-lib.sh 2014-05-29 23:00:27.000000000 +0200 +++ new/resource-agents-3.9.5+git432/rgmanager/src/resources/utils/fs-lib.sh 2014-06-19 21:56:51.000000000 +0200 @@ -273,6 +273,7 @@ kill_procs_using_mount () { declare mp declare procs + declare mmap_procs if [ $# -lt 1 -o -z "$1" ]; then ocf_log err "Usage: kill_procs_using_mount mount_point [signal]" @@ -290,6 +291,10 @@ # anything held open in mount point after the slash procs=$(find /proc/[0-9]*/ -type l -lname "${mp}/*" -or -lname "${mp}" 2>/dev/null | awk -F/ '{print $3}' | uniq) + # anything with memory mapping to something in the mountpoint + mmap_procs=$(grep " ${mp}" /proc/[0-9]*/maps | awk -F/ '{print $3}' | uniq) + procs=$(echo -e "${procs}\n${mmap_procs}" | sort | uniq) + for pid in $procs; do if [ -n "$2" ]; then kill -s $2 $pid -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
