Package: cluster-glue
Version: 1.0.12~rc1+hg2777-1
Severity: wishlist
Hi,
Here is improvement for /etc/init.d/logd (in hg repo: logd/logd.in)
The patch should apply cleanly to Hg:
2010-12-16 2549 045999e8bbe2 Added tag debian-cluster-glue-1.0.7-2
Here is the patch description:
[PATCH] Handle exit and error messages in more standard manner.
- Send errors to STDERR
- Prefix messages with "ERROR:" to help noticing them.
- New generic Die() function to handle details.
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.2.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_DK.UTF-8, LC_CTYPE=en_DK.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages cluster-glue depends on:
ii libbz2-1.0 1.0.6-5
ii libc6 2.17-97
ii libcurl3 7.34.0-1
ii libglib2.0-0 2.36.4-1
ii liblrm2 1.0.10+hg2722-1.1
ii libltdl7 2.4.2-1.6
pn libopenhpi2 <none>
pn libopenipmi0 <none>
ii libpils2 1.0.10+hg2722-1.1
ii libplumb2 1.0.10+hg2722-1.1
ii libplumbgpl2 1.0.10+hg2722-1.1
pn libsnmp15 <none>
pn libssl0.9.8 <none>
ii libstonith1 1.0.10+hg2722-1.1
ii libtimedate-perl 2.3000-1
ii libuuid1 2.20.1-5.6
ii libxml2 2.9.1+dfsg1-3
ii perl 5.18.2-2
ii python 2.7.5-5
cluster-glue recommends no packages.
cluster-glue suggests no packages.
>From 12efff33d65894737f4bf7f5a016a592d9bc9d1c Mon Sep 17 00:00:00 2001
From: Jari Aalto <[email protected]>
Date: Fri, 28 Feb 2014 11:44:45 +0200
Subject: [PATCH] Handle exit and error messages in more standard manner.
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit
- Send errors to STDERR
- Prefix messages with "ERROR:" to help noticing them.
- New generic Die() function to handle details.
Signed-off-by: Jari Aalto <[email protected]>
---
logd.orig | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 105 insertions(+)
create mode 100755 logd.orig
diff --git a/logd.orig b/logd.orig
new file mode 100755
index 0000000..1f8f2af
--- /dev/null
+++ b/logd.orig
@@ -0,0 +1,105 @@
+#!/bin/sh
+#
+#
+# logd Start logd (non-blocking log service)
+#
+# Author: Dejan Muhamedagic <[email protected]>
+# (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
+
+LOGD_CFG=/etc/logd.cf
+LOGD_OPT=""
+[ -f "$LOGD_CFG" ] && LOGD_OPT="-c $LOGD_CFG"
+LOGD_BIN="/usr/lib/heartbeat/ha_logd"
+
+Die ()
+{
+ code=$1
+ shift
+
+ echo "$@" >&2
+ exit $ode
+}
+
+if [ ! -f $LOGD_BIN ]; then
+ Die 5 -n "ERROR: ha_logd not installed."
+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
+ Die 1 "ERROR: starting logd failed"
+ fi
+ echo "ok"
+ exit 0
+}
+
+StopLogd() {
+ echo -n "Stopping ha_logd: "
+
+ $LOGD_BIN -s >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ echo "NOTE: logd is already stopped"
+ return 0
+ fi
+
+ $LOGD_BIN -k >/dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ Die 1 "ERROR: stopping logd failed"
+ 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
+ ;;
+
+ *)
+ Die 1 "Unknown arg. Usage: $0 {start|stop|status|restart}"
+ ;;
+esac
+
--
1.8.5.3