diff -u syslog-ng-2.0.9/debian/syslog-ng.init syslog-ng-2.0.9/debian/syslog-ng.init
--- syslog-ng-2.0.9/debian/syslog-ng.init
+++ syslog-ng-2.0.9/debian/syslog-ng.init
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
 ### BEGIN INIT INFO
 # Provides:          syslog
 # Required-Start:    $local_fs $network $time $remote_fs
@@ -51,6 +51,24 @@
 SYSLOGNG="/sbin/syslog-ng"
 NAME="syslog-ng"

+# By default we only set the pidfile option
+SYSLOGNG_OPTIONS="-p '$PIDFILE'"
+
+# Do we have a non-root user set?
+if [ -n "$SYSLOGNG_USER" ]; then
+  SYSLOGNG_OPTIONS+=" -u '$SYSLOGNG_USER'"
+fi
+
+# Do we have a non-root group set?
+if [ -n "$SYSLOGNG_GROUP" ]; then
+  SYSLOGNG_OPTIONS+=" -g '$SYSLOGNG_GROUP'"
+fi
+
+# Do we have a chroot jail set?
+if [ -n "$SYSLOGNG_CHROOT" ]; then
+  SYSLOGNG_OPTIONS+=" -C '$SYSLOGNG_CHROOT'"
+fi
+
 create_xconsole() {
   if [ ! -e /dev/xconsole ]
   then
@@ -61,7 +79,7 @@
 syslogng_start() {
     log_daemon_msg "Starting system logging" "$NAME"
     start-stop-daemon --start --quiet --exec "$SYSLOGNG" \
-                      --pidfile "$PIDFILE" -- -p "$PIDFILE"
+                      --pidfile "$PIDFILE" -- $SYSLOGNG_OPTIONS
     RET="$?"
     log_end_msg $RET
     return $RET



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to