1 --- sanlock-2.5/init.d/sanlock.orig 2012-09-30 10:16:54.308331928 +0200
2 +++ sanlock-2.5/init.d/sanlock 2012-09-30 10:51:21.691622171 +0200
4 [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
7 - [ -x $exec ] || exit 5
9 - if [ ! -d /var/run/$prog ]; then
10 - install -d -o $SANLOCKUSER -g $SANLOCKUSER -m 775 /var/run/$prog
11 - [ -x /sbin/restorecon ] && restorecon /var/run/$prog
12 + # Check if the service is already running?
13 + if [ -f /var/lock/subsys/sanlock ]; then
14 + msg_already_running "sanlock"
18 - echo -n $"Starting $prog: "
19 + msg_starting "sanlock"
20 daemon $prog daemon $SANLOCKOPTS
23 [ $retval -eq 0 ] && touch $lockfile
28 + if [ ! -f /var/lock/subsys/sanlock ]; then
29 + msg_not_running "sanlock"
32 PID=$(pidofproc -p $runfile $prog)
34 - echo -n $"Sending stop signal $prog ($PID): "
35 killproc -p $runfile $prog -TERM
39 if [ $retval -ne 0 ]; then
43 - echo -n $"Waiting for $prog ($PID) to stop:"
44 + show "Waiting for %s (%s) to stop:" "$prog" "$PID"
48 while checkpid $PID; do
50 timeout=$((timeout - 1))
51 if [ "$timeout" -le 0 ]; then
80 - rh_status >/dev/null 2>&1
82 + if [ ! -f /var/lock/subsys/sanlock ]; then
83 + msg_not_running "sanlock"
94 - rh_status_q && exit 0
99 - rh_status_q || exit 0
109 - rh_status_q || exit 7
121 - condrestart|try-restart)
122 - rh_status_q || exit 0
124 + status --pidfile $runfile sanlock
128 - echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
130 + msg_usage "$0 {start|stop|status|restart||try-restart|force-reload}"
135 --- sanlock-3.2.4/init.d/wdmd.orig 2015-09-10 17:23:16.258102320 +0200
136 +++ sanlock-3.2.4/init.d/wdmd 2015-09-10 17:31:02.341416003 +0200
137 @@ -42,114 +42,105 @@
140 if [ $retval -ne 0 ]; then
141 - echo -n $"Loading the softdog kernel module: "
142 + show "Loading the softdog kernel module: "
143 modprobe softdog && udevadm settle
147 if [ $retval -ne 0 ]; then
158 + # Check if the service is already running?
159 + if [ -f $lockfile ]; then
160 + msg_already_running "wdmd"
166 [ -x $exec ] || exit 5
168 - if [ ! -d /var/run/$prog ]; then
169 - install -d -g $WDMDGROUP -m 775 /var/run/$prog
170 - [ -x /sbin/restorecon ] && restorecon /var/run/$prog
173 - echo -n $"Starting $prog: "
174 + msg_starting "wdmd"
175 daemon $prog $WDMDOPTS
178 [ $retval -eq 0 ] && touch $lockfile
183 + if [ ! -f $lockfile ]; then
184 + msg_not_running "wdmd"
187 PID=$(pidofproc -p $runfile $prog)
189 - echo -n $"Sending stop signal $prog ($PID): "
190 killproc -p $runfile $prog -TERM
194 if [ $retval -ne 0 ]; then
198 - echo -n $"Waiting for $prog ($PID) to stop:"
199 + show "Waiting for %s (%s) to stop:" "$prog" "$PID"
202 while checkpid $PID; do
204 timeout=$((timeout - 1))
205 if [ "$timeout" -le 0 ]; then
221 - rh_status_q && stop
223 + if [ ! -f $lockfile ]; then
224 + msg_not_running "wdmd"
241 - rh_status >/dev/null 2>&1
246 - rh_status_q && exit 0
250 - rh_status_q || exit 0
257 - rh_status_q || exit 7
271 + status --pidfile $runfile wdmd
273 condrestart|try-restart)
274 rh_status_q || exit 0
279 - echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
281 + msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|force-reload}"
286 --- sanlock-3.2.4/init.d/fence_sanlockd.orig 2015-06-19 18:26:03.000000000 +0200
287 +++ sanlock-3.2.4/init.d/fence_sanlockd 2015-09-10 20:58:46.917559578 +0200
289 [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
292 - [ -x $exec ] || exit 5
294 + # Check if the service is already running?
295 + if [ -f /var/lock/subsys/sanlock ]; then
296 + msg_already_running "sanlock"
300 # start wdmd and sanlock daemons if they aren't running
301 + /etc/rc.d/init.d/wdmd status >/dev/null 2>&1 || /etc/rc.d/init.d/wdmd start
302 + /etc/rc.d/init.d/sanlock status >/dev/null 2>&1 || /etc/rc.d/init.d/sanlock start
304 - service wdmd status > /dev/null 2>&1 || service wdmd start
306 - service sanlock status > /dev/null 2>&1 || service sanlock start
308 - [ ! -d /var/run/$prog ] && install -d -m 775 /var/run/$prog
310 - [ ! -d /var/run/$agent ] && install -d -m 775 /var/run/$agent
312 - [ -n "$(which restorecon)" ] && \
313 - [ -x "$(which restorecon)" ] && \
314 - restorecon /var/run/$prog
316 - [ -n "$(which restorecon)" ] && \
317 - [ -x "$(which restorecon)" ] && \
318 - restorecon /var/run/$agent
320 - echo -n $"Starting $prog: "
321 + msg_starting "$prog"
322 daemon $prog $FENCESANLOCKDOPTS
325 [ $retval -eq 0 ] && touch $lockfile
330 + if [ ! -f /var/lock/subsys/$prog ]; then
331 + msg_not_running "$prog"
334 agent_ps="$(ps ax -o pid,args | grep fence_sanlock | grep -v grep | grep -v fence_sanlockd)"
336 [ -n "$agent_ps" ] && {
337 agent_pid="$(echo $agent_ps | awk '{print $1}')"
338 - echo -n "cannot stop while $agent $agent_pid is running"
341 + echo "Cannot stop while $agent $agent_pid is running" >&2
346 # Ideally, we'd like a general way to check if anything
348 if [ -d /sys/kernel/dlm/ ]; then
349 count="$(ls -A /sys/kernel/dlm/ | wc -l)"
350 if [ $count -ne 0 ]; then
351 - echo -n "cannot stop while dlm lockspaces exist"
354 + echo "Cannot stop while dlm lockspaces exist" >&2
360 if [ -d /sys/kernel/config/dlm/cluster ]; then
361 # this dir exists while dlm_controld is running
362 - echo -n "cannot stop while dlm is running"
365 + echo "Cannot stop while dlm is running" >&2
370 PID=$(pidofproc -p $runfile $prog)
372 # We have to use SIGHUP to mean stop because sanlock
373 # uses SIGTERM to mean that the lockspace failed.
375 - echo -n $"Sending stop signal $prog ($PID): "
376 killproc -p $runfile $prog -HUP
380 if [ $retval -ne 0 ]; then
382 @@ -113,75 +104,65 @@
386 - echo -n $"Waiting for $prog ($PID) to stop:"
387 + show "Waiting for %s (%s) to stop:" "$prog" "$PID"
390 while checkpid $PID; do
392 timeout=$((timeout - 1))
393 if [ "$timeout" -le 0 ]; then
404 # stop wdmd and sanlock daemons if they are running
406 - service sanlock status > /dev/null 2>&1 && service sanlock stop
408 - service wdmd status > /dev/null 2>&1 && service wdmd stop
409 + /etc/rc.d/init.d/sanlock status >/dev/null 2>&1 && /etc/rc.d/init.d/sanlock stop
410 + /etc/rc.d/init.d/wdmd status >/dev/null 2>&1 && /etc/rc.d/init.d/wdmd stop
416 - rh_status_q && stop
429 - rh_status >/dev/null 2>&1
431 + if [ ! -f /var/lock/subsys/$prog ]; then
432 + msg_not_running "$prog"
444 - rh_status_q && exit 0
449 - rh_status_q || exit 0
458 rh_status_q || exit 7
467 + status --pidfile $runfile $prog
470 condrestart|try-restart)
471 - rh_status_q || exit 0
476 - echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
478 + msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|force-reload}"