[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-167-g4319a8f
Stephen Gran
steve at lobefin.net
Fri Jun 12 19:12:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 731d0f8cc31f0f033161aa26be63ec2cb1dcded5
Author: Stephen Gran <steve at lobefin.net>
Date: Fri Jun 12 19:54:10 2009 +0100
Define status_of_proc in the event that it's not in lsb/init-functions
Signed-off-by: Stephen Gran <steve at lobefin.net>
diff --git a/debian/clamav-daemon.init.in b/debian/clamav-daemon.init.in
index 6f1f123..9c5a449 100644
--- a/debian/clamav-daemon.init.in
+++ b/debian/clamav-daemon.init.in
@@ -29,6 +29,9 @@ SUPERVISORARGS="--name=$NAME --respawn $DAEMON -F $SUPERVISORPIDFILE"
[ -x "$DAEMON" ] || exit 0
[ -r /etc/default/clamav-daemon ] && . /etc/default/clamav-daemon
+
+#COMMON-FUNCTIONS#
+
. /lib/lsb/init-functions
if [ ! -f "$CLAMAVCONF" ]; then
@@ -39,8 +42,6 @@ if [ ! -f "$CLAMAVCONF" ]; then
exit 1;
fi
-#COMMON-FUNCTIONS#
-
slurp_config "$CLAMAVCONF"
if [ -n "$Example" ]; then
diff --git a/debian/clamav-freshclam.init.in b/debian/clamav-freshclam.init.in
index 61c0e6e..1ef6788 100644
--- a/debian/clamav-freshclam.init.in
+++ b/debian/clamav-freshclam.init.in
@@ -22,10 +22,10 @@ FRESHCLAM_CONF_FILE=/etc/clamav/freshclam.conf
PIDFILE=/var/run/clamav/freshclam.pid
[ -f /var/lib/clamav/interface ] && INTERFACE=`cat /var/lib/clamav/interface`
-. /lib/lsb/init-functions
-
#COMMON-FUNCTIONS#
+. /lib/lsb/init-functions
+
slurp_config "$FRESHCLAM_CONF_FILE"
[ -n "$PidFile" ] && PIDFILE="$PidFile"
diff --git a/debian/clamav-milter.init.in b/debian/clamav-milter.init.in
index 2c120f5..6c43292 100644
--- a/debian/clamav-milter.init.in
+++ b/debian/clamav-milter.init.in
@@ -27,6 +27,8 @@ CLAMAVDAEMONUPGRADE="/var/run/clamav-daemon-being-upgraded"
[ -x "$DAEMON" ] || exit 0
[ ! -r $DEFAULT ] || . $DEFAULT
+#COMMON-FUNCTIONS#
+
. /lib/lsb/init-functions
if [ ! -f "$CLAMAVCONF" ]; then
@@ -37,8 +39,6 @@ if [ ! -f "$CLAMAVCONF" ]; then
exit 0
fi
-#COMMON-FUNCTIONS#
-
slurp_config "$CLAMAVCONF"
[ -n "$User" ] || User=clamav
diff --git a/debian/common_functions b/debian/common_functions
index 153a2c7..0ae7f6d 100644
--- a/debian/common_functions
+++ b/debian/common_functions
@@ -1,3 +1,32 @@
+status_of_proc () {
+ local pidfile daemon name status
+
+ pidfile=
+ OPTIND=1
+ while getopts p: opt ; do
+ case "$opt" in
+ p) pidfile="$OPTARG";;
+ esac
+ done
+ shift $(($OPTIND - 1))
+
+ if [ -n "$pidfile" ]; then
+ pidfile="-p $pidfile"
+ fi
+ daemon="$1"
+ name="$2"
+
+ status="0"
+ pidofproc $pidfile $daemon >/dev/null || status="$?"
+ if [ "$status" = 0 ]; then
+ log_success_msg "$name is running"
+ return 0
+ else
+ log_failure_msg "$name is not running"
+ return $status
+ fi
+}
+
to_lower()
{
word="$1"
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list