Updating update-centos7-v16-to-v17.sh, /var/run ownership

This commit is contained in:
dpeca 2016-11-17 18:17:38 +01:00
parent f799572f1a
commit 37fa99b757

View file

@ -71,6 +71,14 @@ if [ -f "/etc/clamd.conf" ] ; then
chown clam:clam /var/log/clamav /var/run/clamav
if [ "$release" -eq '7' ]; then
sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service
file="/usr/lib/systemd/system/clamd.service"
if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
sed -i "s/Type = simple/Type = simple\nExecStartPre = \/usr\/bin\/mkdir -p \/var\/run\/clamav\nExecStartPre = \/usr\/bin\/chown -R clam:clam \/var\/run\/clamav/g" $file
if [ ! -d "/var/run/clamav" ]; then
mkdir /var/run/clamav
fi
chown -R clam:clam /var/run/clamav
fi
systemctl daemon-reload
fi
fi