From fa73d16538366c8643299f455d625269f0782dcc Mon Sep 17 00:00:00 2001 From: dpeca Date: Thu, 17 Nov 2016 17:44:01 +0100 Subject: [PATCH] Correcting path for clamav-daemon.service --- install/vst-install-debian.sh | 4 ++-- upd/update-debian8-v16-to-v17.sh | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/install/vst-install-debian.sh b/install/vst-install-debian.sh index 514863a0..2370f319 100755 --- a/install/vst-install-debian.sh +++ b/install/vst-install-debian.sh @@ -1045,8 +1045,8 @@ if [ "$clamd" = 'yes' ]; then mkdir /var/run/clamav fi chown -R clamav:clamav /var/run/clamav - if [ -f "/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" ]; then - file="/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" + if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then + file="/lib/systemd/system/clamav-daemon.service" if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file fi diff --git a/upd/update-debian8-v16-to-v17.sh b/upd/update-debian8-v16-to-v17.sh index dcc5d945..1ecbfa89 100755 --- a/upd/update-debian8-v16-to-v17.sh +++ b/upd/update-debian8-v16-to-v17.sh @@ -121,10 +121,14 @@ fi # Fixing /var/run/clamav permissions -if [ -f "/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" ]; then - file="/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" +if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then + file="/lib/systemd/system/clamav-daemon.service" if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file - service clamav-daemon restart + if [ ! -d "/var/run/clamav" ]; then + mkdir /var/run/clamav + fi + chown -R clamav:clamav /var/run/clamav + service clamav-daemon restart /dev/null 2>&1 fi fi