aboutsummaryrefslogtreecommitdiffstats
path: root/extra/clamav/clamd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'extra/clamav/clamd.initd')
-rw-r--r--extra/clamav/clamd.initd56
1 files changed, 0 insertions, 56 deletions
diff --git a/extra/clamav/clamd.initd b/extra/clamav/clamd.initd
deleted file mode 100644
index d3b9155572..0000000000
--- a/extra/clamav/clamd.initd
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/sbin/runscript
-
-opts="logfix reload"
-NAME=clamd
-CONF=/etc/clamav/clamd.conf
-
-depend() {
- need net
- provide antivirus
-}
-
-start() {
- local clamd_socket=$(awk '$1 == "LocalSocket" { print $2 }' $CONF)
-
- logfix
-
- if [ -S "${clamd_socket:=/tmp/clamd}" ]; then
- rm -f ${clamd_socket}
- fi
- ebegin "Starting ${NAME}"
- start-stop-daemon --start --quiet \
- --nicelevel ${CLAMD_NICELEVEL:-0} \
- --exec /usr/sbin/clamd
- eend $? "Failed to start ${NAME}"
-}
-
-stop() {
- ebegin "Stopping ${NAME}"
- start-stop-daemon --stop --quiet --exec /usr/sbin/clamd
- eend $?
-}
-
-reload() {
- ebegin "Reloading ${NAME}"
- if ! service_started "${NAME}" ; then
- eend 1 "${NAME} is not started"
- return 1
- fi
- start-stop-daemon --stop --oknodo --signal HUP \
- --exec /usr/sbin/clamd
- eend $?
-}
-
-logfix() {
- # fix clamd log permissions
- # (might be clobbered by logrotate or something)
- local logfile=`awk '$1 == "LogFile" { print $2 }' $CONF`
- local clamav_user=`awk '$1 == "User" { print $2 }' $CONF`
- if [ -n "${logfile}" ] && [ -n "${clamav_user}" ]; then
- if [ ! -f "${logfile}" ]; then
- touch ${logfile}
- fi
- chown ${clamav_user} ${logfile}
- chmod 640 ${logfile}
- fi
-}