|
16 | 16 | # with this program; if not, write to the Free Software Foundation, Inc., |
17 | 17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
18 | 18 | # |
| 19 | +### BEGIN INIT INFO |
| 20 | +# Provides: sbd |
| 21 | +# Required-Start: $network $remote_fs |
| 22 | +# Should-Start: $syslog iscsi multipath-tools corosync |
| 23 | +# X-Start-Before: pacemaker |
| 24 | +# Required-Stop: $network $remote_fs |
| 25 | +# Should-Stop: iscsi multipath-tools corosync |
| 26 | +# X-Stop-After: pacemaker |
| 27 | +# Default-Start: 2 3 4 5 |
| 28 | +# Default-Stop: 0 1 6 |
| 29 | +# Short-Description: Shared-storage based fencing daemon |
| 30 | +# Description: SBD provides a node fencing mechanism for |
| 31 | +# Pacemaker-based clusters through the exchange of |
| 32 | +# messages via shared block storage such as for |
| 33 | +# example a SAN, iSCSI, FCoE. It can be used as |
| 34 | +# a STONITH mechanism in all configurations that |
| 35 | +# have reliable shared storage. |
| 36 | +### END INIT INFO |
19 | 37 |
|
20 | 38 | SBD_CONFIG=@CONFIGDIR@/sbd |
21 | 39 | SBD_BIN="/usr/sbin/sbd" |
22 | 40 |
|
| 41 | +[ -e /lib/lsb/init-functions ] && . /lib/lsb/init-functions |
| 42 | + |
23 | 43 | test -x $SBD_BIN || exit 1 |
24 | 44 | test -f $SBD_CONFIG || exit 1 |
25 | 45 |
|
@@ -84,11 +104,23 @@ stop() { |
84 | 104 | done |
85 | 105 | } |
86 | 106 |
|
| 107 | +status() { |
| 108 | + if pidofproc -p $SBD_PIDFILE $SBD_BIN >/dev/null 2>&1 ; then |
| 109 | + echo "SBD is running." |
| 110 | + return 0 |
| 111 | + else |
| 112 | + echo "SBD is not running." |
| 113 | + return 1 |
| 114 | + fi |
| 115 | +} |
| 116 | + |
87 | 117 | case "$1" in |
88 | | -start|stop) |
| 118 | +start|stop|status) |
89 | 119 | $1 ;; |
| 120 | +restart|force-reload) |
| 121 | + stop; start ;; |
90 | 122 | *) |
91 | | - echo "Usage: $0 (start|stop)" |
| 123 | + echo "Usage: $0 (start|stop|status|restart|force-reload)" |
92 | 124 | exit 1 |
93 | 125 | ;; |
94 | 126 | esac |
|
0 commit comments