[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#652575: rsyslog: /etc/init.d/rsyslog modifications for GNU/Hurd



Source: rsyslog
Version: 5.8.6-1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd

Hi,

Now that upstream rsyslog has abandoned the use of PATH_MAX it will
build properly on GNU/Hurd too. Unfortunately the installed init file
does not work, since on GNU/Hurd /proc/<pid>/stat is reporting rsyslog
as /usr/sbin/rsyslogd, not rsyslogd. The attached patch fixes this.

Since the start-stop-daemon does not support a full path, a bug will be
filed to that package too. When solved there the --name will be added,
as --name $DAEMON instead of being blank as it is with the attached
patch. Here $DAEMON=$RSYSLOG_BIN=/usr/sbin/rsyslogd. Also the creation
of xconsole is disabled, since it does not work yet.

Thanks!
--- a/debian/rsyslog.init	2011-11-02 23:31:54.000000000 +0100
+++ b/debian/rsyslog.init	2011-12-18 19:06:36.000000000 +0100
@@ -37,6 +37,8 @@
 # Define LSB log_* functions.
 . /lib/lsb/init-functions
 
+OS=$(uname -s)
+
 do_start()
 {
 	DAEMON="$RSYSLOGD_BIN"
@@ -59,7 +61,11 @@
 	#   0 if daemon has been stopped
 	#   1 if daemon was already stopped
 	#   other if daemon could not be stopped or a failure occurred
-	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	if [ "$OS" = "GNU" ]; then
+	    start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE
+	else
+	    start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
+	fi
 }
 
 #
@@ -69,12 +75,16 @@
 	NAME="$RSYSLOGD"
 	PIDFILE="$RSYSLOGD_PIDFILE"
 
-	start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME
+	if [ "$OS" = "GNU" ]; then
+	    start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE
+	else
+	    start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME
+	fi
 }
 
 create_xconsole() {
 	XCONSOLE=/dev/xconsole
-	if [ "$(uname -s)" = "GNU/kFreeBSD" ]; then
+	if [ "$OS" = "GNU/kFreeBSD" ]; then
 		XCONSOLE=/var/run/xconsole
 		ln -sf $XCONSOLE /dev/xconsole
 	fi
@@ -94,7 +104,9 @@
 case "$1" in
   start)
 	log_daemon_msg "Starting $DESC" "$RSYSLOGD"
-	create_xconsole
+	if [ "$OS" != "GNU" ]; then
+	    create_xconsole
+	fi
 	do_start
 	case "$?" in
 		0) sendsigs_omit

Reply to: