Search
j0ke.net Open Build Service
>
Projects
>
GFS
>
cluster2
> cluster-qdiskd-init.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File cluster-qdiskd-init.patch of Package cluster2 (Revision 19)
Currently displaying revision
19
,
show latest
--- cman/init.d/qdiskd.orig 2008-12-30 22:03:05.000000000 +0100 +++ cman/init.d/qdiskd 2009-03-30 10:06:58.000000000 +0200 @@ -9,18 +9,30 @@ # Provides: qdiskd # Required-Start: cman # Required-Stop: cman -# Default-Start: +# Default-Start: 2 3 5 # Default-Stop: # Short-Description: start/stop quorum disk daemon # Description: start/stop quorum disk daemon ### END INIT INFO -. /etc/init.d/functions +. /etc/rc.status + +# Shell functions sourced from /etc/rc.status: +# rc_check check and set local and overall rc status +# rc_status check and set local and overall rc status +# rc_status -v ditto but be verbose in local rc status +# rc_status -v -r ditto and clear the local rc status +# rc_failed set local and overall rc status to failed +# rc_reset clear local rc status (overall remains) +# rc_exit exit appropriate to overall rc status + +# First reset status of this service +rc_reset + [ -f /etc/sysconfig/cluster ] && . /etc/sysconfig/cluster LOCK_FILE="/var/lock/subsys/qdiskd" - -rtrn=1 +QDISKD="/usr/sbin/qdiskd" retries=0 # See how we were called. @@ -28,55 +40,34 @@ start) echo -n "Starting the Quorum Disk Daemon:" - $0 status >/dev/null - if [ $? -eq 0 ]; then - echo_success - echo - exit 0 - fi - - qdiskd -Q - rtrn=$? - if [ $rtrn = 0 ]; then - touch $LOCK_FILE - echo_success - echo - else - echo_failure - echo - fi - + startproc $QDISKD + rc_status ;; stop) echo -n "Stopping the Quorum Disk Daemon:" - killproc qdiskd + killproc $QDISKD while [ -n "`pidof qdiskd`" ] && [ $retries -lt 5 ]; do sleep 1 - killproc qdiskd + killproc $QDISKD ((retries++)) done if [ -z "`pidof qdiskd`" ]; then - echo_success - echo - rtrn=0 + rc_status rm -f $LOCK_FILE else - echo_failure - echo - rtrn=1 + rc_failed fi ;; restart|reload) $0 stop || exit $? $0 start - rtrn=$? ;; status) - status qdiskd - rtrn=$? + checkproc $QDISKD + rc_status ;; *) @@ -84,4 +75,4 @@ ;; esac -exit $rtrn +rc_exit