]> git.pld-linux.org Git - packages/sanlock.git/blob - sanlock-restore-sysv.patch
- updated to 3.9.1, readded SysV scripts for sanlock and wdmd
[packages/sanlock.git] / sanlock-restore-sysv.patch
1 --- sanlock-3.9.1/init.d/sanlock-sysv.orig      1970-01-01 01:00:00.000000000 +0100
2 +++ sanlock-3.9.1/init.d/sanlock-sysv   2023-12-13 23:47:19.000000000 +0100
3 @@ -0,0 +1,126 @@
4 +#!/bin/bash
5 +#
6 +# sanlock - SAN-based lock manager
7 +#
8 +# chkconfig: 2345 97 03
9 +# description: starts and stops sanlock daemon
10 +#
11 +
12 +
13 +### BEGIN INIT INFO
14 +# Provides: sanlock
15 +# Required-Start: $time $syslog wdmd
16 +# Required-Stop: $syslog
17 +# Should-Start:
18 +# Should-Stop:
19 +# Default-Start: 2 3 4 5
20 +# Default-Stop: 0 1 6
21 +# Short-Description: starts and stops sanlock daemon
22 +# Description: starts and stops sanlock daemon
23 +### END INIT INFO
24 +
25 +. /etc/rc.d/init.d/functions
26 +
27 +prog="sanlock"
28 +runfile="/run/$prog/$prog.pid"
29 +lockfile="/var/lock/subsys/$prog"
30 +exec="/usr/sbin/$prog"
31 +
32 +SANLOCKUSER="sanlock"
33 +SANLOCKOPTS="-U $SANLOCKUSER -G $SANLOCKUSER"
34 +
35 +[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
36 +
37 +start() {
38 +       [ -x $exec ] || exit 5
39 +
40 +       if [ ! -d /run/$prog ]; then
41 +               install -d -o $SANLOCKUSER -g $SANLOCKUSER -m 775 /run/$prog
42 +               [ -x /sbin/restorecon ] && restorecon /run/$prog
43 +       fi
44 +
45 +       echo -n $"Starting $prog: "
46 +       daemon $prog daemon $SANLOCKOPTS
47 +       retval=$?
48 +       echo
49 +       [ $retval -eq 0 ] && touch $lockfile
50 +       return $retval
51 +}
52 +
53 +stop() {
54 +       PID=$(pidofproc -p $runfile $prog)
55 +
56 +       echo -n $"Sending stop signal $prog ($PID): "
57 +       killproc -p $runfile $prog -TERM
58 +       retval=$?
59 +       echo
60 +
61 +       if [ $retval -ne 0 ]; then
62 +               return $retval
63 +       fi
64 +
65 +       echo -n $"Waiting for $prog ($PID) to stop:"
66 +
67 +       timeout=10
68 +       while checkpid $PID; do
69 +               sleep 1
70 +               timeout=$((timeout - 1))
71 +               if [ "$timeout" -le 0 ]; then
72 +                       failure; echo
73 +                       return 1
74 +               fi
75 +       done
76 +
77 +       success; echo
78 +       rm -f $lockfile
79 +       return $retval
80 +}
81 +
82 +restart() {
83 +       rh_status_q && stop
84 +       start
85 +}
86 +
87 +reload() {
88 +       restart
89 +}
90 +
91 +rh_status() {
92 +       status $prog
93 +}
94 +
95 +rh_status_q() {
96 +       rh_status >/dev/null 2>&1
97 +}
98 +
99 +case "$1" in
100 +       start)
101 +               rh_status_q && exit 0
102 +               $1
103 +               ;;
104 +       stop)
105 +               rh_status_q || exit 0
106 +               $1
107 +               ;;
108 +       restart)
109 +               $1
110 +               ;;
111 +       reload)
112 +               rh_status_q || exit 7
113 +               $1
114 +               ;;
115 +       force-reload)
116 +               force_reload
117 +               ;;
118 +       status)
119 +               rh_status
120 +               ;;
121 +       condrestart|try-restart)
122 +               rh_status_q || exit 0
123 +               restart
124 +               ;;
125 +       *)
126 +               echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
127 +               exit 2
128 +esac
129 +exit $?
130 --- sanlock-3.9.1/init.d/wdmd-sysv.orig 1970-01-01 01:00:00.000000000 +0100
131 +++ sanlock-3.9.1/init.d/wdmd-sysv      2023-12-13 23:47:19.000000000 +0100
132 @@ -0,0 +1,155 @@
133 +#!/bin/bash
134 +#
135 +# wdmd - watchdog multiplexing daemon
136 +#
137 +# chkconfig: 2345 97 03
138 +# description: starts and stops wdmd daemon
139 +#
140 +
141 +
142 +### BEGIN INIT INFO
143 +# Provides: wdmd
144 +# Required-Start: $time $syslog
145 +# Required-Stop: $syslog
146 +# Should-Start:
147 +# Should-Stop:
148 +# Default-Start: 2 3 4 5
149 +# Default-Stop: 0 1 6
150 +# Short-Description: starts and stops wdmd daemon
151 +# Description: starts and stops wdmd daemon
152 +### END INIT INFO
153 +
154 +. /etc/rc.d/init.d/functions
155 +
156 +prog="wdmd"
157 +runfile="/run/$prog/$prog.pid"
158 +lockfile="/var/lock/subsys/$prog"
159 +exec="/usr/sbin/$prog"
160 +
161 +WDMDGROUP="sanlock"
162 +WDMDOPTS="-G $WDMDGROUP"
163 +
164 +[ -f /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
165 +
166 +watchdog_probe() {
167 +       $exec --probe > /dev/null 2>&1
168 +       retval=$?
169 +       return $retval
170 +}
171 +
172 +watchdog_check() {
173 +       watchdog_probe
174 +       retval=$?
175 +
176 +       if [ $retval -ne 0 ]; then
177 +               echo -n $"Loading the softdog kernel module: "
178 +               modprobe softdog && udevadm settle
179 +
180 +               watchdog_probe
181 +               retval=$?
182 +               if [ $retval -ne 0 ]; then
183 +                       failure; echo
184 +                       return 1
185 +               fi
186 +               success; echo
187 +       fi
188 +}
189 +
190 +start() {
191 +       watchdog_check
192 +
193 +       [ -x $exec ] || exit 5
194 +
195 +       if [ ! -d /run/$prog ]; then
196 +               install -d -g $WDMDGROUP -m 775 /run/$prog
197 +               [ -x /sbin/restorecon ] && restorecon /run/$prog
198 +       fi
199 +
200 +       echo -n $"Starting $prog: "
201 +       daemon $prog $WDMDOPTS
202 +       retval=$?
203 +       echo
204 +       [ $retval -eq 0 ] && touch $lockfile
205 +       return $retval
206 +}
207 +
208 +stop() {
209 +       PID=$(pidofproc -p $runfile $prog)
210 +
211 +       echo -n $"Sending stop signal $prog ($PID): "
212 +       killproc -p $runfile $prog -TERM
213 +       retval=$?
214 +       echo
215 +
216 +       if [ $retval -ne 0 ]; then
217 +               return $retval
218 +       fi
219 +
220 +       echo -n $"Waiting for $prog ($PID) to stop:"
221 +
222 +       timeout=10
223 +       while checkpid $PID; do
224 +               sleep 1
225 +               timeout=$((timeout - 1))
226 +               if [ "$timeout" -le 0 ]; then
227 +                       failure; echo
228 +                       return 1
229 +               fi
230 +       done
231 +
232 +       success; echo
233 +       rm -f $lockfile
234 +       return $retval
235 +}
236 +
237 +restart() {
238 +       rh_status_q && stop
239 +       start
240 +}
241 +
242 +reload() {
243 +       restart
244 +}
245 +
246 +rh_status() {
247 +       status $prog
248 +}
249 +
250 +rh_status_q() {
251 +       rh_status >/dev/null 2>&1
252 +}
253 +
254 +case "$1" in
255 +       start)
256 +               rh_status_q && exit 0
257 +               $1
258 +               ;;
259 +       stop)
260 +               rh_status_q || exit 0
261 +               $1
262 +               ;;
263 +       restart)
264 +               $1
265 +               ;;
266 +       reload)
267 +               rh_status_q || exit 7
268 +               $1
269 +               ;;
270 +       watchdog-check)
271 +               watchdog_check
272 +               ;;
273 +       force-reload)
274 +               force_reload
275 +               ;;
276 +       status)
277 +               rh_status
278 +               ;;
279 +       condrestart|try-restart)
280 +               rh_status_q || exit 0
281 +               restart
282 +               ;;
283 +       *)
284 +               echo $"Usage $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
285 +               exit 2
286 +esac
287 +exit $?
This page took 0.116869 seconds and 3 git commands to generate.