Skip to content

Commit fa73d16

Browse files
committed
Correcting path for clamav-daemon.service
1 parent 1709671 commit fa73d16

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

install/vst-install-debian.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,8 +1045,8 @@ if [ "$clamd" = 'yes' ]; then
10451045
mkdir /var/run/clamav
10461046
fi
10471047
chown -R clamav:clamav /var/run/clamav
1048-
if [ -f "/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" ]; then
1049-
file="/etc/systemd/system/multi-user.target.wants/clamav-daemon.service"
1048+
if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
1049+
file="/lib/systemd/system/clamav-daemon.service"
10501050
if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
10511051
sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
10521052
fi

upd/update-debian8-v16-to-v17.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,14 @@ fi
121121

122122

123123
# Fixing /var/run/clamav permissions
124-
if [ -f "/etc/systemd/system/multi-user.target.wants/clamav-daemon.service" ]; then
125-
file="/etc/systemd/system/multi-user.target.wants/clamav-daemon.service"
124+
if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
125+
file="/lib/systemd/system/clamav-daemon.service"
126126
if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
127127
sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
128-
service clamav-daemon restart
128+
if [ ! -d "/var/run/clamav" ]; then
129+
mkdir /var/run/clamav
130+
fi
131+
chown -R clamav:clamav /var/run/clamav
132+
service clamav-daemon restart /dev/null 2>&1
129133
fi
130134
fi

0 commit comments

Comments
 (0)