Skip to content

Commit 37fa99b

Browse files
committed
Updating update-centos7-v16-to-v17.sh, /var/run ownership
1 parent f799572 commit 37fa99b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ if [ -f "/etc/clamd.conf" ] ; then
7171
chown clam:clam /var/log/clamav /var/run/clamav
7272
if [ "$release" -eq '7' ]; then
7373
sed -i "s/nofork/foreground/" /usr/lib/systemd/system/clamd.service
74+
file="/usr/lib/systemd/system/clamd.service"
75+
if [ $( grep -ic "mkdir" $file ) -eq 0 ]; then
76+
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
77+
if [ ! -d "/var/run/clamav" ]; then
78+
mkdir /var/run/clamav
79+
fi
80+
chown -R clam:clam /var/run/clamav
81+
fi
7482
systemctl daemon-reload
7583
fi
7684
fi

0 commit comments

Comments
 (0)