Package: syslog-ng
Version: 2.0.0-1
Severity: normal
Tags: patch

Please use the logging functions defined by lsb instead of calling echo
directly. This makes it possible to customize the output and send it to
boot splash systems like splashy or usplash.

A proposed patch is attached.

In addition you should add a versions Depend on lsb-base (>= 3.0-6)

Cheers,
Michael


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (300, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-rc6
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages syslog-ng depends on:
ii  libc6                         2.5-1      GNU C Library: Shared libraries

Versions of packages syslog-ng recommends:
ii  logrotate                     3.7.1-3    Log rotation utility

-- no debconf information
--- syslog-ng.orig      2007-04-14 04:31:42.000000000 +0200
+++ syslog-ng   2007-04-14 04:45:01.000000000 +0200
@@ -25,6 +25,10 @@
 #we source /etc/default/syslog-ng if exists
 [ -r /etc/default/syslog-ng ] && . /etc/default/syslog-ng
 
+# Define LSB log_* functions.
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
+. /lib/lsb/init-functions
+
 case "x$CONSOLE_LOG_LEVEL" in
   x[1-8])
     dmesg -n $CONSOLE_LOG_LEVEL
@@ -32,13 +36,13 @@
   x)
     ;;
   *)
-    echo "CONSOLE_LOG_LEVEL is of unaccepted value."
+    log_warning_msg "CONSOLE_LOG_LEVEL is of unaccepted value."
     ;;
 esac
 
 if [ -n "$KERNEL_RINGBUF_SIZE" ]
 then
-  echo "KERNEL_RINGBUF_SIZE option is useless and therefore removed."
+  log_warning_msg "KERNEL_RINGBUF_SIZE option is useless and therefore 
removed."
 fi
 
 # stop syslog-ng before changing its PID file!
@@ -55,30 +59,35 @@
 }
                                 
 syslogng_start() {
-    echo -n "Starting system logging: $NAME"
-    start-stop-daemon --start --quiet --exec "$SYSLOGNG" --pidfile "$PIDFILE" 
-- -p "$PIDFILE" \
-      || { echo " start failed."; return 1; }
-    echo "."
-    return 0
+    log_daemon_msg "Starting system logging" "$NAME"
+    start-stop-daemon --start --quiet --exec "$SYSLOGNG" \
+                      --pidfile "$PIDFILE" -- -p "$PIDFILE" 
+    RET="$?"
+    log_end_msg $RET
+    return $RET
 }
 
 syslogng_stop() {
-    echo -n "Stopping system logging: $NAME"
-    start-stop-daemon --stop --quiet --name "$NAME" --retry 3 --pidfile 
"$PIDFILE" || { echo " not running."; return 1; }
-    echo "."
+    log_daemon_msg "Stopping system logging" "$NAME"
+    start-stop-daemon --stop --quiet --name "$NAME" --retry 3 \
+                      --pidfile "$PIDFILE"
+    RET="$?"
+    log_end_msg $RET
     rm -f "$PIDFILE"
-    return 0
+    return $RET
 }
 
 syslogng_reload() {
-    echo -n "Reload system logging: $NAME"
+    log_daemon_msg "Reload system logging" "$NAME"
     if /sbin/syslog-ng -s
     then
-      start-stop-daemon --stop --signal 1 --quiet --exec "$SYSLOGNG" --pidfile 
"$PIDFILE" || return 1
-      echo "."
-      return 0
+      start-stop-daemon --stop --signal 1 --quiet --exec "$SYSLOGNG" \
+                        --pidfile "$PIDFILE"
+      RET="$?"
+      log_end_msg $?
+      return $RET
     else
-      echo " Failed"
+      log_end_msg 1
       return 1
     fi
 }

Reply via email to