mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 22:04:01 -07:00
clamav-daemon.service fix and clamav sock fix
This commit is contained in:
parent
52eeff1b6a
commit
3be3510916
1 changed files with 21 additions and 8 deletions
|
@ -76,18 +76,31 @@ if [ "$check_cron" -eq 0 ]; then
|
||||||
crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab -
|
crontab -l | { cat; echo "10 2 * * 6 sudo find /home/*/tmp/ -type f -mtime +5 -exec rm {} \;"; } | crontab -
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f "/usr/local/vesta/data/upgrades/change-clamav-socket" ]; then
|
# make sure clamav-daemon.service has mkdir fix
|
||||||
touch /usr/local/vesta/data/upgrades/change-clamav-socket
|
if [ -f "/lib/systemd/system/clamav-daemon.service" ]; then
|
||||||
check_grep=$(grep -c '/var/lib/clamav/clamd.sock' /etc/clamav/clamd.conf)
|
check_grep=$(grep -c 'mkdir' /lib/systemd/system/clamav-daemon.service)
|
||||||
if [ "$check_grep" -eq 0 ]; then
|
if [ "$check_grep" -eq 0 ]; then
|
||||||
touch /var/lib/clamav/clamd.sock
|
echo "=== patching clamav-daemon.service"
|
||||||
chown clamav:clamav /var/lib/clamav/clamd.sock
|
exec_pre1='ExecStartPre=-/bin/mkdir -p /var/run/clamav'
|
||||||
sed -i "s#/var/run/clamav/clamd.ctl#/var/lib/clamav/clamd.sock#g" /etc/clamav/clamd.conf
|
exec_pre2='ExecStartPre=-/bin/chown -R clamav:clamav /var/run/clamav'
|
||||||
sed -i "s#/var/run/clamav/clamd.ctl#/var/lib/clamav/clamd.sock#g" /etc/exim4/exim4.conf.template
|
sed -i "s|\[Service\]|[Service]\n$exec_pre1\n$exec_pre2|g" /lib/systemd/system/clamav-daemon.service
|
||||||
|
systemctl daemon-reload
|
||||||
|
systemctl restart clamav-daemon
|
||||||
|
systemctl restart clamav-freshclam
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# reverting to default clamd sock
|
||||||
|
if [ ! -f "/usr/local/vesta/data/upgrades/change-clamav-socket-v2" ]; then
|
||||||
|
touch /usr/local/vesta/data/upgrades/change-clamav-socket-v2
|
||||||
|
sed -i "s#/var/lib/clamav/clamd.sock#/var/run/clamav/clamd.ctl#g" /etc/clamav/clamd.conf
|
||||||
|
sed -i "s#/var/lib/clamav/clamd.sock#/var/run/clamav/clamd.ctl#g" /etc/exim4/exim4.conf.template
|
||||||
|
sed -i "s#/var/lib/clamav/clamd.sock#/var/run/clamav/clamd.ctl#g" /lib/systemd/system/clamav-daemon.socket
|
||||||
|
sed -i "s#=/run/clamav/clamd.ctl#=/var/run/clamav/clamd.ctl#g" /lib/systemd/system/clamav-daemon.socket
|
||||||
|
systemctl daemon-reload
|
||||||
systemctl restart clamav-daemon
|
systemctl restart clamav-daemon
|
||||||
systemctl restart clamav-freshclam
|
systemctl restart clamav-freshclam
|
||||||
systemctl restart exim4
|
systemctl restart exim4
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run custom triggers
|
# Run custom triggers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue