From 37fa99b757486bf9eee36a8cffb8dfeef9cbb1f2 Mon Sep 17 00:00:00 2001 From: dpeca Date: Thu, 17 Nov 2016 18:17:38 +0100 Subject: [PATCH] Updating update-centos7-v16-to-v17.sh, /var/run ownership --- upd/update-centos7-v16-to-v17.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/upd/update-centos7-v16-to-v17.sh b/upd/update-centos7-v16-to-v17.sh index 6233ff09b..d11f329d6 100755 --- a/upd/update-centos7-v16-to-v17.sh +++ b/upd/update-centos7-v16-to-v17.sh @@ -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