diff options
author | Valery Kartel <valery.kartel@gmail.com> | 2015-12-07 18:32:08 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-12-08 14:26:59 +0000 |
commit | bedaab5b374d5c54a91e2ce7bf50b95e1dd09183 (patch) | |
tree | 1f28e81c5300fa6aece604d1df712e06dcb27cb8 /main/clamav/freshclam.initd | |
parent | 42203a737e081c24bcac87b07346da59893f9968 (diff) | |
download | aports-bedaab5b374d5c54a91e2ce7bf50b95e1dd09183.tar.bz2 aports-bedaab5b374d5c54a91e2ce7bf50b95e1dd09183.tar.xz |
main/clamav: upgrade to 0.99. Minor fixes in APKBUILD, init and logrotate scripts (second release)
Diffstat (limited to 'main/clamav/freshclam.initd')
-rw-r--r-- | main/clamav/freshclam.initd | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/main/clamav/freshclam.initd b/main/clamav/freshclam.initd index 4b71fbf2b4..279b529066 100644 --- a/main/clamav/freshclam.initd +++ b/main/clamav/freshclam.initd @@ -1,17 +1,26 @@ #!/sbin/openrc-run -extra_started_commands="reload" -extra_commands="logfix" +CONF=/etc/clamav/freshclam.conf +pidfile=/run/clamav/freshclam.pid command=/usr/bin/freshclam -pidfile=/var/run/clamav/freshclam.pid -CONF=/etc/clamav/freshclam.conf +extra_started_commands="reload" +extra_commands="logfix" +required_files=$CONF depend() { need net after firewall } +start_pre() { + local pid=`awk '$1 == "PidFile" { print $2 }' $CONF` + local owner=`awk '$1 == "DatabaseOwner" { print $2 }' $CONF` + [ "x$pid" != "x" ] && pidfile=$pid + checkpath --directory --owner ${owner:-clamav} \ + --mode 750 ${pidfile%/*} +} + start() { ebegin "Starting freshclam" start-stop-daemon --start --quiet \ @@ -23,20 +32,12 @@ start() { eend $? } -stop() { - ebegin "Stopping freshclam" - start-stop-daemon --stop --quiet --pidfile $pidfile - eend $? -} - reload() { - ebegin "Reloading freshclam" - start-stop-daemon --stop --signal HUP \ - --exec $command --pidfile $pidfile + ebegin "Reloading ${SVCNAME}" + start-stop-daemon --signal HUP --pidfile $pidfile --name $SVCNAME eend $? } - logfix() { # fix freshclam log permissions # (might be clobbered by logrotate or something) @@ -50,4 +51,3 @@ logfix() { chmod 640 ${logfile} fi } - |