[packages/sanlock] - updated to 2.5 - updated init-pld patch
qboosh
qboosh at pld-linux.org
Sun Sep 30 10:54:47 CEST 2012
commit 7140d736d2e8324ac907a98147d64b72123b8e1a
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Sep 30 10:56:03 2012 +0200
- updated to 2.5
- updated init-pld patch
sanlock-init-pld.patch | 214 +++++++++++++++++++++++++++----------------------
sanlock.spec | 4 +-
2 files changed, 118 insertions(+), 100 deletions(-)
---
diff --git a/sanlock.spec b/sanlock.spec
index 2188513..1200c6a 100644
--- a/sanlock.spec
+++ b/sanlock.spec
@@ -2,12 +2,12 @@
Summary: Shared storage lock manager
Summary(pl.UTF-8): Zarządca blokad dla współdzielonego składowania danych
Name: sanlock
-Version: 2.4
+Version: 2.5
Release: 1
License: LGPL v2+ (libsanlock_client, libwdmd), GPL v2 (libsanlock, utilities)
Group: Networking
Source0: https://fedorahosted.org/releases/s/a/sanlock/%{name}-%{version}.tar.gz
-# Source0-md5: 5d056f13f1bec99c858867910b557380
+# Source0-md5: d89e5f22f4b2b4c08fcc9af74949647a
Patch0: %{name}-link.patch
Patch1: %{name}-init-pld.patch
URL: https://fedorahosted.org/sanlock/
diff --git a/sanlock-init-pld.patch b/sanlock-init-pld.patch
index 06bd20e..470850e 100644
--- a/sanlock-init-pld.patch
+++ b/sanlock-init-pld.patch
@@ -1,6 +1,6 @@
---- 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() {
@@ -18,63 +18,54 @@
- 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() {
@@ -83,14 +74,19 @@
-
-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
@@ -106,7 +102,8 @@
;;
restart)
- $1
-+ restart
++ stop
++ start
;;
- reload)
- rh_status_q || exit 7
@@ -125,19 +122,18 @@
- 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
++exit $retval
+--- sanlock-2.5/init.d/wdmd.orig 2012-09-24 17:35:09.000000000 +0200
++++ sanlock-2.5/init.d/wdmd 2012-09-30 10:51:00.684955942 +0200
@@ -3,7 +3,7 @@
# wdmd - watchdog multiplexing daemon
#
@@ -147,22 +143,9 @@
#
-@@ -32,83 +32,69 @@ WDMDOPTS="-G $WDMDGROUP"
- [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
-
- 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
-+ msg_already_running "wdmd"
-+ return
-+ fi
+@@ -33,105 +33,92 @@
+ watchdog_check() {
if [ ! -c /dev/watchdog ]; then
- echo -n $"Loading the softdog kernel module: "
+ show "Loading the softdog kernel module: "
@@ -171,46 +154,75 @@
- echo
+ [ -c /dev/watchdog ] && ok || fail
fi
+ }
+ start() {
++ # Check if the service is already running?
++ if [ -f /var/lock/subsys/wdmd ]; then
++ msg_already_running "wdmd"
++ return
++ fi
++
+ watchdog_check
+
+- [ -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
+ 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() {
-+condrestart() {
-+ if [ ! -f /var/lock/subsys/wdmd ]; then
-+ msg_not_running "wdmd"
-+ RETVAL=$1
-+ return
-+ fi
- stop
- start
- }
+- rh_status_q && stop
+- start
+-}
-
-reload() {
- restart
@@ -222,9 +234,16 @@
-
-rh_status_q() {
- rh_status >/dev/null 2>&1
--}
--
-+
++condrestart() {
++ if [ ! -f /var/lock/subsys/wdmd ]; then
++ msg_not_running "wdmd"
++ retval=$1
++ return
++ fi
++ stop
++ start
+ }
+
case "$1" in
start)
- rh_status_q && exit 0
@@ -238,33 +257,32 @@
;;
restart)
- $1
-+ stop
-+ start
- ;;
+- ;;
- reload)
- rh_status_q || exit 7
- $1
-+ try-restart)
-+ condrestart 0
++ stop
++ start
;;
force-reload)
- force_reload
+ condrestart 7
;;
- status)
+- status)
- rh_status
-- ;;
++ try-restart)
++ condrestart 0
+ ;;
- condrestart|try-restart)
- rh_status_q || exit 0
- restart
++ status)
+ status --pidfile $runfile wdmd
;;
*)
- 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}"
-+ exit 3
++ msg_usage "$0 {start|stop|status|restart|try-restart|force-reload}"
+ exit 2
esac
-exit $?
-+exit $RETVAL
-
++exit $retval
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/sanlock.git/commitdiff/7140d736d2e8324ac907a98147d64b72123b8e1a
More information about the pld-cvs-commit
mailing list