---- sanlock-2.4/init.d/sanlock.orig 2012-07-23 16:24:38.000000000 +0200
-+++ sanlock-2.4/init.d/sanlock 2012-09-02 21:09:14.181273151 +0200
-@@ -32,94 +32,85 @@ SANLOCKOPTS="-U $SANLOCKUSER -G $SANLOCK
+--- sanlock-2.5/init.d/sanlock.orig 2012-09-30 10:16:54.308331928 +0200
++++ sanlock-2.5/init.d/sanlock 2012-09-30 10:51:21.691622171 +0200
+@@ -32,95 +32,86 @@
[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
start() {
- echo -n $"Starting $prog: "
+ msg_starting "sanlock"
daemon $prog daemon $SANLOCKOPTS
-- retval=$?
+ retval=$?
- echo
-- [ $retval -eq 0 ] && touch $lockfile
-- return $retval
-+ RETVAL=$?
-+ [ $RETVAL -eq 0 ] && touch $lockfile
-+ return $RETVAL
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
}
stop() {
-- echo -n $"Sending stop signal $prog: "
+ if [ ! -f /var/lock/subsys/sanlock ]; then
+ msg_not_running "sanlock"
+ return
+ fi
+ PID=$(pidofproc -p $runfile $prog)
+
+- echo -n $"Sending stop signal $prog ($PID): "
killproc -p $runfile $prog -TERM
-- retval=$?
+ retval=$?
- echo
-+ RETVAL=$?
-- if [ $retval -ne 0 ]; then
-- return $retval
-+ if [ $RETVAL -ne 0 ]; then
-+ return $RETVAL
+ if [ $retval -ne 0 ]; then
+ return $retval
fi
-- echo -n $"Waiting for $prog to stop:"
-+ show "Waiting for %s to stop" "$prog"
+- echo -n $"Waiting for $prog ($PID) to stop:"
++ show "Waiting for %s (%s) to stop:" "$prog" "$PID"
+ busy
+
timeout=10
- while [ -e $runfile ]; do
+ while checkpid $PID; do
sleep 1
timeout=$((timeout - 1))
if [ "$timeout" -le 0 ]; then
- failure; echo
+- return 1
+ fail
- return 1
++ retval=1
++ return $retval
fi
done
- success; echo
+ ok
rm -f $lockfile
-- return $retval
-+ return $RETVAL
+ return $retval
}
-restart() {
-+condrestart() {
-+ if [ ! -f /var/lock/subsys/sanlock ]; then
-+ msg_not_running "sanlock"
-+ RETVAL=$1
-+ return
-+ fi
- stop && start
-- retval=$?
-- return $retval
+- rh_status_q && stop
+- start
-}
-
-reload() {
-
-rh_status() {
- status $prog
-+ RETVAL=$?
-+ return $RETVAL
- }
-
+-}
+-
-rh_status_q() {
- rh_status >/dev/null 2>&1
-+restart() {
++condrestart() {
++ if [ ! -f /var/lock/subsys/sanlock ]; then
++ msg_not_running "sanlock"
++ retval=$1
++ return $retval
++ fi
+ stop && start
++ retval=$?
++ return $retval
}
case "$1" in
;;
restart)
- $1
-+ restart
++ stop
++ start
;;
- reload)
- rh_status_q || exit 7
- rh_status_q || exit 0
- restart
+ status --pidfile $runfile sanlock
-+ RETVAL=$?
++ retval=$?
;;
*)
- echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
++ msg_usage "$0 {start|stop|status|restart||try-restart|force-reload}"
+ exit 3
esac
-exit $?
--
-+exit $RETVAL
---- sanlock-2.4/init.d/wdmd.orig 2012-07-23 16:24:38.000000000 +0200
-+++ sanlock-2.4/init.d/wdmd 2012-09-02 21:14:08.491267019 +0200
-@@ -3,7 +3,7 @@
- # wdmd - watchdog multiplexing daemon
- #
- # chkconfig: 2345 97 03
--# description: starts and stops sanlock daemon
-+# description: starts and stops wdmd daemon
- #
-
-
-@@ -32,83 +32,69 @@ WDMDOPTS="-G $WDMDGROUP"
- [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
++exit $retval
+--- sanlock-3.2.4/init.d/wdmd.orig 2015-09-10 17:23:16.258102320 +0200
++++ sanlock-3.2.4/init.d/wdmd 2015-09-10 17:31:02.341416003 +0200
+@@ -42,114 +42,105 @@
+ retval=$?
+
+ if [ $retval -ne 0 ]; then
+- echo -n $"Loading the softdog kernel module: "
++ show "Loading the softdog kernel module: "
+ modprobe softdog && udevadm settle
+
+ watchdog_probe
+ retval=$?
+ if [ $retval -ne 0 ]; then
+- failure; echo
++ fail
+ return 1
+ fi
+- success; echo
++ ok
+ fi
+ }
start() {
-- [ -x $exec ] || exit 5
--
-- if [ ! -d /var/run/$prog ]; then
-- mkdir -p /var/run/$prog
-- [ -x /sbin/restorecon ] && restorecon /var/run/$prog
-- fi
+ # Check if the service is already running?
-+ if [ -f /var/lock/subsys/wdmd ]; then
++ if [ -f $lockfile ]; then
+ msg_already_running "wdmd"
+ return
+ fi
++
+ watchdog_check
- if [ ! -c /dev/watchdog ]; then
-- echo -n $"Loading the softdog kernel module: "
-+ show "Loading the softdog kernel module: "
- modprobe softdog && udevadm settle
-- [ -c /dev/watchdog ] && success || failure
-- echo
-+ [ -c /dev/watchdog ] && ok || fail
- fi
+ [ -x $exec ] || exit 5
+- if [ ! -d /var/run/$prog ]; then
+- install -d -g $WDMDGROUP -m 775 /var/run/$prog
+- [ -x /sbin/restorecon ] && restorecon /var/run/$prog
+- fi
+-
- echo -n $"Starting $prog: "
+ msg_starting "wdmd"
daemon $prog $WDMDOPTS
-- retval=$?
+ retval=$?
- echo
-- [ $retval -eq 0 ] && touch $lockfile
-- return $retval
-+ RETVAL=$?
-+ [ $RETVAL -eq 0 ] && touch $lockfile
-+ return $RETVAL
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
}
stop() {
-- echo -n $"Stopping $prog: "
-- killproc -p $runfile $prog -TERM
-- retval=$?
-- echo
-- [ $retval -eq 0 ] && rm -f $lockfile
-- return $retval
-+ if [ ! -f /var/lock/subsys/wdmd ]; then
++ if [ ! -f $lockfile ]; then
+ msg_not_running "wdmd"
+ return
+ fi
-+ killproc -p $runfile $prog
-+ RETVAL=$?
-+ [ $RETVAL -eq 0 ] && rm -f $lockfile
-+ return $RETVAL
+ PID=$(pidofproc -p $runfile $prog)
+
+- echo -n $"Sending stop signal $prog ($PID): "
+ killproc -p $runfile $prog -TERM
+ retval=$?
+- echo
+
+ if [ $retval -ne 0 ]; then
+ return $retval
+ fi
+
+- echo -n $"Waiting for $prog ($PID) to stop:"
++ show "Waiting for %s (%s) to stop:" "$prog" "$PID"
+
+ timeout=10
+ while checkpid $PID; do
+ sleep 1
+ timeout=$((timeout - 1))
+ if [ "$timeout" -le 0 ]; then
+- failure; echo
+- return 1
++ fail
++ retval=1
++ return $retval
+ fi
+ done
+
+- success; echo
++ ok
+ rm -f $lockfile
+ return $retval
}
-restart() {
+- rh_status_q && stop
+condrestart() {
-+ if [ ! -f /var/lock/subsys/wdmd ]; then
++ if [ ! -f $lockfile ]; then
+ msg_not_running "wdmd"
-+ RETVAL=$1
-+ return
++ retval=$1
++ return $retval
+ fi
- stop
++ stop
start
}
--
+
-reload() {
- restart
-}
-rh_status_q() {
- rh_status >/dev/null 2>&1
-}
+-
+ case "$1" in
+ start)
+- rh_status_q && exit 0
+ $1
+ ;;
+ stop)
+- rh_status_q || exit 0
+ $1
+ ;;
+ restart)
+- $1
+- ;;
+- reload)
+- rh_status_q || exit 7
+- $1
++ stop
++ start
+ ;;
+ watchdog-check)
+ watchdog_check
+ ;;
+ force-reload)
+- force_reload
++ condrestart 7
+ ;;
+ status)
+- rh_status
++ status --pidfile $runfile wdmd
+ ;;
+ condrestart|try-restart)
+ rh_status_q || exit 0
+- restart
++ condrestart 0
+ ;;
+ *)
+- echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
+- exit 2
++ msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|force-reload}"
++ exit 3
+ esac
+-exit $?
++exit $retval
+--- sanlock-3.2.4/init.d/fence_sanlockd.orig 2015-06-19 18:26:03.000000000 +0200
++++ sanlock-3.2.4/init.d/fence_sanlockd 2015-09-10 20:58:46.917559578 +0200
+@@ -33,42 +33,35 @@
+ [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
+
+ start() {
+- [ -x $exec ] || exit 5
+-
++ # Check if the service is already running?
++ if [ -f /var/lock/subsys/sanlock ]; then
++ msg_already_running "sanlock"
++ return
++ fi
++
+ # start wdmd and sanlock daemons if they aren't running
++ /etc/rc.d/init.d/wdmd status >/dev/null 2>&1 || /etc/rc.d/init.d/wdmd start
++ /etc/rc.d/init.d/sanlock status >/dev/null 2>&1 || /etc/rc.d/init.d/sanlock start
+
+- service wdmd status > /dev/null 2>&1 || service wdmd start
+-
+- service sanlock status > /dev/null 2>&1 || service sanlock start
+-
+- [ ! -d /var/run/$prog ] && install -d -m 775 /var/run/$prog
+-
+- [ ! -d /var/run/$agent ] && install -d -m 775 /var/run/$agent
+-
+- [ -n "$(which restorecon)" ] && \
+- [ -x "$(which restorecon)" ] && \
+- restorecon /var/run/$prog
+-
+- [ -n "$(which restorecon)" ] && \
+- [ -x "$(which restorecon)" ] && \
+- restorecon /var/run/$agent
+-
+- echo -n $"Starting $prog: "
++ msg_starting "$prog"
+ daemon $prog $FENCESANLOCKDOPTS
+ retval=$?
+- echo
+ [ $retval -eq 0 ] && touch $lockfile
+ return $retval
+ }
+
+ stop() {
++ if [ ! -f /var/lock/subsys/$prog ]; then
++ msg_not_running "$prog"
++ return
++ fi
+ agent_ps="$(ps ax -o pid,args | grep fence_sanlock | grep -v grep | grep -v fence_sanlockd)"
+
+ [ -n "$agent_ps" ] && {
+ agent_pid="$(echo $agent_ps | awk '{print $1}')"
+- echo -n "cannot stop while $agent $agent_pid is running"
+- failure; echo
+- return 1
++ echo "Cannot stop while $agent $agent_pid is running" >&2
++ retval=1
++ return $retval
+ }
+
+ # Ideally, we'd like a general way to check if anything
+@@ -78,17 +71,17 @@
+ if [ -d /sys/kernel/dlm/ ]; then
+ count="$(ls -A /sys/kernel/dlm/ | wc -l)"
+ if [ $count -ne 0 ]; then
+- echo -n "cannot stop while dlm lockspaces exist"
+- failure; echo
+- return 1
++ echo "Cannot stop while dlm lockspaces exist" >&2
++ retval=1
++ return $retval
+ fi
+ fi
+
+ if [ -d /sys/kernel/config/dlm/cluster ]; then
+ # this dir exists while dlm_controld is running
+- echo -n "cannot stop while dlm is running"
+- failure; echo
+- return 1
++ echo "Cannot stop while dlm is running" >&2
++ retval=1
++ return $retval
+ fi
+
+ PID=$(pidofproc -p $runfile $prog)
+@@ -96,10 +89,8 @@
+ # We have to use SIGHUP to mean stop because sanlock
+ # uses SIGTERM to mean that the lockspace failed.
+
+- echo -n $"Sending stop signal $prog ($PID): "
+ killproc -p $runfile $prog -HUP
+ retval=$?
+- echo
+
+ if [ $retval -ne 0 ]; then
+ return $retval
+@@ -113,75 +104,65 @@
+ echo "" > $fifofile
+ fi
+
+- echo -n $"Waiting for $prog ($PID) to stop:"
++ show "Waiting for %s (%s) to stop:" "$prog" "$PID"
+
+ timeout=10
+ while checkpid $PID; do
+ sleep 1
+ timeout=$((timeout - 1))
+ if [ "$timeout" -le 0 ]; then
+- failure; echo
++ fail
+ return 1
+ fi
+ done
+
+- success; echo
++ ok
+ rm -f $lockfile
+
+ # stop wdmd and sanlock daemons if they are running
+-
+- service sanlock status > /dev/null 2>&1 && service sanlock stop
+-
+- service wdmd status > /dev/null 2>&1 && service wdmd stop
++ /etc/rc.d/init.d/sanlock status >/dev/null 2>&1 && /etc/rc.d/init.d/sanlock stop
++ /etc/rc.d/init.d/wdmd status >/dev/null 2>&1 && /etc/rc.d/init.d/wdmd stop
+
+ return $retval
+ }
+
+-restart() {
+- rh_status_q && stop
+- start
+-}
+-
+-reload() {
+- restart
+-}
+-
+-rh_status() {
+- status $prog
+-}
+-
+-rh_status_q() {
+- rh_status >/dev/null 2>&1
++condrestart() {
++ if [ ! -f /var/lock/subsys/$prog ]; then
++ msg_not_running "$prog"
++ retval=$1
++ return $retval
++ fi
++ stop && start
++ retval=$?
++ return $retval
+ }
-
+
case "$1" in
;;
restart)
- $1
-+ stop
-+ start
++ stop && start
;;
-- reload)
-- rh_status_q || exit 7
-- $1
-+ try-restart)
-+ condrestart 0
+ reload)
+ rh_status_q || exit 7
+ $1
;;
force-reload)
- force_reload
;;
status)
- rh_status
-- ;;
-- condrestart|try-restart)
++ status --pidfile $runfile $prog
++ retval=$?
+ ;;
+ condrestart|try-restart)
- rh_status_q || exit 0
- restart
-+ status --pidfile $runfile wdmd
++ condrestart 0
;;
*)
- echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
- exit 2
-+ msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
++ msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|force-reload}"
+ exit 3
esac
--exit $?
-+exit $RETVAL
-
+ exit $?