aboutsummaryrefslogtreecommitdiffstats
path: root/main/clamav/freshclam.initd
diff options
context:
space:
mode:
Diffstat (limited to 'main/clamav/freshclam.initd')
-rw-r--r--main/clamav/freshclam.initd31
1 files changed, 12 insertions, 19 deletions
diff --git a/main/clamav/freshclam.initd b/main/clamav/freshclam.initd
index 2efd2e48d7..be8aa16e49 100644
--- a/main/clamav/freshclam.initd
+++ b/main/clamav/freshclam.initd
@@ -3,8 +3,8 @@
extra_started_commands="reload"
extra_commands="logfix"
-NAME=freshclam
-DAEMON=/usr/bin/$NAME
+command=/usr/bin/freshclam
+pidfile=/var/run/clamav/freshclam.pid
CONF=/etc/clamav/freshclam.conf
depend() {
@@ -16,30 +16,23 @@ start() {
ebegin "Starting freshclam"
start-stop-daemon --start --quiet \
--nicelevel ${FRESHCLAM_NICELEVEL:-0} \
- --exec /usr/bin/freshclam -- -d
- retcode=$?
- if [ ${retcode} = 1 ]; then
- eend 0
- einfo "Virus databases are already up to date."
- else
- eend ${retcode} "Failed to start freshclam"
- fi
+ --exec $command \
+ -- \
+ --daemon \
+ --pid=$pidfile
+ eend $?
}
stop() {
- ebegin "Stopping ${NAME}"
- start-stop-daemon --stop --quiet --name ${NAME}
+ ebegin "Stopping freshclam"
+ start-stop-daemon --stop --quiet --pidfile $pidfile
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 ${DAEMON} --name $NAME
+ ebegin "Reloading freshclam"
+ start-stop-daemon --stop --signal HUP \
+ --exec $command --pidfile $pidfile
eend $?
}