Skip to content

Commit 1709671

Browse files
authored
Persistent fix for /var/run/clamav permissions
1 parent dfebb3f commit 1709671

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

install/vst-install-debian.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,6 +1045,13 @@ 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"
1050+
if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
1051+
sed -i "s/\[Service\]/\[Service\]\nExecStartPre = \/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/bin\/chown -R clamav:clamav \/var\/run\/clamav/g" $file
1052+
fi
1053+
fi
1054+
10481055
service clamav-daemon start
10491056
check_result $? "clamav-daeom start failed"
10501057
fi

0 commit comments

Comments
 (0)