[Debian-ha-commits] [cluster-glue] 01/01: Re-added support for sysvinit

Richard Winters devrik-guest at moszumanska.debian.org
Tue Apr 21 20:57:06 UTC 2015


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

devrik-guest pushed a commit to branch master
in repository cluster-glue.

commit 24476cd2aadc1da22f2c23bb80bb8ec0df3d8cc2
Author: Richard B Winters <rik at mmogp.com>
Date:   Tue Apr 21 16:56:39 2015 -0400

    Re-added support for sysvinit
    
     - cluster-glue.logd.init restored
     - debian/rules updated to install init with default parameters
    
    Change-Id: I0e608763a6138266f6a70223b3d60f58bf190b19
    Signed-off-by: Richard B Winters <rik at mmogp.com>
---
 debian/cluster-glue.logd.init | 102 ++++++++++++++++++++++++++++++++++++++++++
 debian/rules                  |   3 ++
 2 files changed, 105 insertions(+)

diff --git a/debian/cluster-glue.logd.init b/debian/cluster-glue.logd.init
new file mode 100644
index 0000000..c803289
--- /dev/null
+++ b/debian/cluster-glue.logd.init
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+#
+# logd     	    Start logd (non-blocking log service)
+#
+# Author:       Dejan Muhamedagic <dmuhamedagic at suse.de>
+#               (After the heartbeat init script)
+# License:      GNU General Public License (GPL)
+#
+#		This script works correctly under SuSE, Debian,
+#		Conectiva, Red Hat and a few others.  Please let me know if it
+#		doesn't work under your distribution, and we'll fix it.
+#		We don't hate anyone, and like for everyone to use
+#		our software, no matter what OS or distribution you're using.
+#
+# chkconfig: 2345 @LOGD_INITSTARTPRI@ @LOGD_INITSTOPPRI@
+# description: Startup script logd service.
+# processname: ha_logd
+# pidfile: /var/run/logd.pid
+# config: /etc/logd.cf
+#
+### BEGIN INIT INFO
+# Description: ha_logd is a non-blocking logging daemon.
+#	It can log messages either to a file or through syslog
+#	daemon.
+# Short-Description: ha_logd logging daemon
+# Provides: ha_logd
+# Required-Start: $network $syslog $remote_fs
+# Required-Stop: $network $syslog $remote_fs
+# X-Start-Before: heartbeat openais
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+LOGD_CFG=/etc/logd.cf
+LOGD_OPT=""
+[ -f "$LOGD_CFG" ] && LOGD_OPT="-c $LOGD_CFG"
+LOGD_BIN="/usr/lib/heartbeat/ha_logd"
+
+if [ ! -f $LOGD_BIN ]; then
+  echo -n "ha_logd not installed."
+  exit 5
+fi
+
+StartLogd() {
+    echo -n "Starting ha_logd: "
+    $LOGD_BIN -s >/dev/null 2>&1
+    if [ $? -eq 0 ]; then
+	echo "logd is already running" 
+	return 0
+    fi
+    
+    $LOGD_BIN -d $LOGD_OPT >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	echo "starting logd failed"
+	exit 1
+    fi
+    echo "ok"
+    exit 0
+}
+
+StopLogd() {
+    echo -n "Stopping ha_logd: "
+
+    $LOGD_BIN -s >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	   echo "logd is already stopped" 
+	   return 0
+    fi
+
+    $LOGD_BIN -k >/dev/null 2>&1
+    if [ $? -ne 0 ]; then
+	echo "stopping logd failed"
+	exit 1
+    fi
+    echo "stopped"
+    exit 0
+}
+
+StatusLogd() {
+  $LOGD_BIN -s
+  exit $?
+}
+
+case "$1" in
+  start) StartLogd ;;
+  status) StatusLogd ;;
+  stop) StopLogd ;;
+  restart|force-reload)
+        sleeptime=1
+	$0 stop && sleep $sleeptime && $0 start
+	echo
+	;;
+
+  *)
+	echo "Usage: $0 {start|stop|status|restart}"
+	exit 1
+esac
+
+
diff --git a/debian/rules b/debian/rules
index 37ccd9c..28241ce 100755
--- a/debian/rules
+++ b/debian/rules
@@ -33,6 +33,9 @@ override_dh_auto_install:
 	ln -rs $(CURDIR)/debian/tmp/usr/share/man/man8/lrmadmin.8 \
 		$(CURDIR)/debian/tmp/usr/share/man/man8/cibsecret.8
 
+override_dh_installinit:
+	dh_installinit --name=logd -pcluster-glue -u 'defaults 20 32'
+
 override_dh_installchangelogs:
 	dh_installchangelogs ChangeLog
 

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



More information about the Debian-HA-Commits mailing list