[Debian-ha-commits] [sbd] 14/16: Include init script for sysv systems

Valentin Vidic vvidic-guest at moszumanska.debian.org
Fri Jun 23 16:49:27 UTC 2017


This is an automated email from the git hooks/post-receive script.

vvidic-guest pushed a commit to branch master
in repository sbd.

commit b62ae37003164aee0bfaf2e1259c47a511896c26
Author: Valentin Vidic <Valentin.Vidic at CARNet.hr>
Date:   Fri Jun 23 17:06:26 2017 +0200

    Include init script for sysv systems
---
 debian/control                |  3 ++-
 debian/patches/sbd-init.patch | 41 +++++++++++++++++++++++++++++++++++++++++
 debian/patches/series         |  1 +
 debian/rules                  |  3 +++
 debian/sbd.install            |  5 ++++-
 5 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index d3f3c52..f467c7a 100644
--- a/debian/control
+++ b/debian/control
@@ -6,6 +6,7 @@ Uploaders: Adrian Vondendriesch <adrian.vondendriesch at credativ.de>,
  Valentin Vidic <Valentin.Vidic at CARNet.hr>
 Build-Depends: debhelper (>= 9),
  dh-autoreconf,
+ dh-exec,
  dh-systemd,
  libglib2.0-dev,
  libcib-dev (>= 1.1.8),
@@ -28,7 +29,7 @@ Vcs-Browser: https://anonscm.debian.org/cgit/debian-ha/sbd.git
 
 Package: sbd
 Architecture: linux-any
-Depends: ${shlibs:Depends}, ${misc:Depends}
+Depends: lsb-base, ${shlibs:Depends}, ${misc:Depends}
 Description: STONITH Block Device daemon
  SBD provides a node fencing mechanism (Shoot the other node in the
  head, STONITH) for Pacemaker-based clusters through the exchange of
diff --git a/debian/patches/sbd-init.patch b/debian/patches/sbd-init.patch
new file mode 100644
index 0000000..04de9df
--- /dev/null
+++ b/debian/patches/sbd-init.patch
@@ -0,0 +1,41 @@
+--- a/src/sbd.sh
++++ b/src/sbd.sh
+@@ -16,10 +16,25 @@
+ # with this program; if not, write to the Free Software Foundation, Inc.,
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ #
++### BEGIN INIT INFO
++# Provides:             sbd
++# Required-Start:       $network $remote_fs
++# Should-Start:         $syslog iscsi multipath-tools corosync
++# X-Start-Before:       pacemaker
++# Required-Stop:        $network $remote_fs
++# Should-Stop:          iscsi multipath-tools corosync
++# X-Stop-After:         pacemaker
++# Default-Start:        2 3 4 5
++# Default-Stop:         0 1 6
++# Short-Description:    Shared-storage based fencing daemon
++# Description:          Shared-storage based fencing daemon
++### END INIT INFO
+ 
+-SBD_CONFIG=/etc/sysconfig/sbd
++SBD_CONFIG=/etc/default/sbd
+ SBD_BIN="/usr/sbin/sbd"
+ 
++. /lib/lsb/init-functions
++
+ test -x $SBD_BIN || exit 1
+ test -f $SBD_CONFIG || exit 1
+ 
+@@ -87,8 +102,10 @@
+ case "$1" in
+ start|stop)
+ 	$1 ;;
++restart|force-reload)
++	stop; start ;;
+ *)
+-	echo "Usage: $0 (start|stop)"
++	echo "Usage: $0 (start|stop|restart|force-reload)"
+ 	exit 1
+ 	;;
+ esac
diff --git a/debian/patches/series b/debian/patches/series
index 451def3..c3b2ba9 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 sbd.service.in-kill-path
 sbd-service_sysconfig-vs-default.patch
 regression_test-exit.patch
+sbd-init.patch
diff --git a/debian/rules b/debian/rules
index 0fd452e..45e4100 100755
--- a/debian/rules
+++ b/debian/rules
@@ -27,3 +27,6 @@ override_dh_auto_configure:
 # sbd is started through corosync.
 override_dh_systemd_start:
 	dh_systemd_start --no-start
+
+override_dh_installinit:
+	dh_installinit --only-scripts --no-start
diff --git a/debian/sbd.install b/debian/sbd.install
old mode 100644
new mode 100755
index 89d5214..ed218ee
--- a/debian/sbd.install
+++ b/debian/sbd.install
@@ -1 +1,4 @@
-/src/sbd.service	/lib/systemd/system/
\ No newline at end of file
+#!/usr/bin/dh-exec
+debian/sbd.default => /etc/default/sbd
+src/sbd.sh => /etc/init.d/sbd
+src/sbd.service /lib/systemd/system/

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-ha/sbd.git



More information about the Debian-HA-Commits mailing list