Source: clamav
Source-Version: 0.99.1+dfsg-1
Severity: wishlist
Tags: patch

Hi!

The attached patch fixes the LSB init script to have more consistent
output.

Thanks,
Guillem
From 6d1f9ade7178ee4012fc657b41e22e0f1c6dd03e Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Sat, 30 Apr 2016 15:29:02 +0200
Subject: [PATCH] clamav: Fix LSB init output

---
 debian/clamav-freshclam.init.in | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/debian/clamav-freshclam.init.in b/debian/clamav-freshclam.init.in
index 259e13d..0719e37 100644
--- a/debian/clamav-freshclam.init.in
+++ b/debian/clamav-freshclam.init.in
@@ -50,7 +50,6 @@ case "$1" in
   su "$DatabaseOwner" -p -s /bin/sh -c "freshclam -l $UpdateLogFile --datadir $DatabaseDirectory"
   ;;
   start)
-  log_daemon_msg "Starting $DESC" "$NAME"
   if [ ! -f "$PidFile" ]; then
     # If clamd is run under a different UID than freshclam then we need
     # to make sure the PidFile can be written or else we won't be able to
@@ -62,16 +61,16 @@ case "$1" in
   if [ -f /etc/cron.d/clamav-freshclam ]; then
     log_warning_msg "Not starting $NAME - cron option selected"
     log_warning_msg "Run the init script with the 'no-daemon' option"
-    log_end_msg 255
     # this is similar to the daemon already running
     exit 0
   fi
-  start-stop-daemon --start --oknodo -c "$DatabaseOwner" --exec $DAEMON --pidfile $PidFile -- -d --quiet --config-file=$FRESHCLAM_CONF_FILE --pid=$PidFile
+  log_daemon_msg "Starting $DESC" "$NAME"
+  start-stop-daemon --start --oknodo -c "$DatabaseOwner" --exec $DAEMON --pidfile $PidFile --quiet -- -d --quiet --config-file=$FRESHCLAM_CONF_FILE --pid=$PidFile
   log_end_msg $?
   ;;
   stop)
   log_daemon_msg "Stopping $DESC" "$NAME"
-  start-stop-daemon --stop --oknodo --name $NAME --pidfile $PidFile --retry TERM/30/KILL/5
+  start-stop-daemon --stop --oknodo --name $NAME --pidfile $PidFile --quiet --retry TERM/30/KILL/5
   log_end_msg $?
   ;;
   restart|force-reload)
@@ -79,14 +78,13 @@ case "$1" in
   $0 start
   ;;
   reload-log)
-  log_daemon_msg "Reloading $DESC" "$NAME"
   # If user wants it run from cron, we only accept no-daemon and stop
   if [ -f /etc/cron.d/clamav-freshclam ]; then
     log_warning_msg "Not reloading log for $NAME - cron option selected"
-    log_end_msg 255
     # log-reloading is not needed, because freshclam is not run as daemon
     exit 0
   fi
+  log_daemon_msg "Reloading $DESC" "$NAME"
   pkill -HUP -F $PidFile $NAME
   log_end_msg $?
   ;;
-- 
2.8.1

Reply via email to