1 --- sanlock-3.8.0/init.d/sanlock.orig 2020-02-08 22:16:26.415493120 +0100
2 +++ sanlock-3.8.0/init.d/sanlock 2020-02-08 22:25:28.369223771 +0100
4 [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
7 - [ -x $exec ] || exit 5
9 - if [ ! -d /run/$prog ]; then
10 - install -d -o $SANLOCKUSER -g $SANLOCKUSER -m 775 /run/$prog
11 - [ -x /sbin/restorecon ] && restorecon /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.8.0/init.d/wdmd.orig 2020-02-08 22:16:26.418826435 +0100
136 +++ sanlock-3.8.0/init.d/wdmd 2020-02-08 22:32:56.383463337 +0100
137 @@ -42,114 +42,103 @@
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
160 - [ -x $exec ] || exit 5
162 - if [ ! -d /run/$prog ]; then
163 - install -d -g $WDMDGROUP -m 775 /run/$prog
164 - [ -x /sbin/restorecon ] && restorecon /run/$prog
165 + # Check if the service is already running?
166 + if [ -f $lockfile ]; then
167 + msg_already_running "wdmd"
171 - 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.8.0/init.d/fence_sanlockd.orig 2019-06-12 21:07:38.000000000 +0200
287 +++ sanlock-3.8.0/init.d/fence_sanlockd 2020-02-08 22:34:27.129638389 +0100
289 [ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
292 - [ -x $exec ] || exit 5
293 + # Check if the service is already running?
294 + if [ -f /var/lock/subsys/sanlock ]; then
295 + msg_already_running "sanlock"
299 # start wdmd and sanlock daemons if they aren't running
300 + /etc/rc.d/init.d/wdmd status >/dev/null 2>&1 || /etc/rc.d/init.d/wdmd start
301 + /etc/rc.d/init.d/sanlock status >/dev/null 2>&1 || /etc/rc.d/init.d/sanlock start
303 - service wdmd status > /dev/null 2>&1 || service wdmd start
305 - service sanlock status > /dev/null 2>&1 || service sanlock start
307 - [ ! -d /run/$prog ] && install -d -m 775 /run/$prog
309 - [ ! -d /run/$agent ] && install -d -m 775 /run/$agent
311 - [ -n "$(which restorecon)" ] && \
312 - [ -x "$(which restorecon)" ] && \
313 - restorecon /run/$prog
315 - [ -n "$(which restorecon)" ] && \
316 - [ -x "$(which restorecon)" ] && \
317 - restorecon /run/$agent
319 - echo -n $"Starting $prog: "
320 + msg_starting "$prog"
321 daemon $prog $FENCESANLOCKDOPTS
324 [ $retval -eq 0 ] && touch $lockfile
329 + if [ ! -f /var/lock/subsys/$prog ]; then
330 + msg_not_running "$prog"
333 agent_ps="$(ps ax -o pid,args | grep fence_sanlock | grep -v grep | grep -v fence_sanlockd)"
335 [ -n "$agent_ps" ] && {
336 agent_pid="$(echo $agent_ps | awk '{print $1}')"
337 - echo -n "cannot stop while $agent $agent_pid is running"
340 + echo "Cannot stop while $agent $agent_pid is running" >&2
345 # Ideally, we'd like a general way to check if anything
347 if [ -d /sys/kernel/dlm/ ]; then
348 count="$(ls -A /sys/kernel/dlm/ | wc -l)"
349 if [ $count -ne 0 ]; then
350 - echo -n "cannot stop while dlm lockspaces exist"
353 + echo "Cannot stop while dlm lockspaces exist" >&2
359 if [ -d /sys/kernel/config/dlm/cluster ]; then
360 # this dir exists while dlm_controld is running
361 - echo -n "cannot stop while dlm is running"
364 + echo "Cannot stop while dlm is running" >&2
369 PID=$(pidofproc -p $runfile $prog)
371 # We have to use SIGHUP to mean stop because sanlock
372 # uses SIGTERM to mean that the lockspace failed.
374 - echo -n $"Sending stop signal $prog ($PID): "
375 killproc -p $runfile $prog -HUP
379 if [ $retval -ne 0 ]; then
381 @@ -113,75 +104,65 @@
385 - echo -n $"Waiting for $prog ($PID) to stop:"
386 + show "Waiting for %s (%s) to stop:" "$prog" "$PID"
389 while checkpid $PID; do
391 timeout=$((timeout - 1))
392 if [ "$timeout" -le 0 ]; then
403 # stop wdmd and sanlock daemons if they are running
405 - service sanlock status > /dev/null 2>&1 && service sanlock stop
407 - service wdmd status > /dev/null 2>&1 && service wdmd stop
408 + /etc/rc.d/init.d/sanlock status >/dev/null 2>&1 && /etc/rc.d/init.d/sanlock stop
409 + /etc/rc.d/init.d/wdmd status >/dev/null 2>&1 && /etc/rc.d/init.d/wdmd stop
415 - rh_status_q && stop
428 - rh_status >/dev/null 2>&1
430 + if [ ! -f /var/lock/subsys/$prog ]; then
431 + msg_not_running "$prog"
443 - rh_status_q && exit 0
448 - rh_status_q || exit 0
457 rh_status_q || exit 7
466 + status --pidfile $runfile $prog
469 condrestart|try-restart)
470 - rh_status_q || exit 0
475 - echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
477 + msg_usage "$0 {start|stop|status|restart|condrestart|try-restart|force-reload}"