Alberto,
In my case what I've done previously was started with a sample file I found here:
https://gist.githubusercontent.com/ChadDevOps/dc5428e8d816344f68b03c99359731f9/raw/73cca0ce75aefa79153cacdcf53a0ce5991195b1/clamonacc.service Modified it so that instead of restarting on failures every 120 seconds, systemd waits on the socket file from clamd to exist before it proceeds to start clamonacc daemon:
--
# /etc/systemd/system/clamonacc.service
[Unit]
Description=ClamAV On Access Scanner
Requires=clamav-daemon.service
After=clamav-daemon.service syslog.target network.target
[Service]
Type=simple
User=root
ExecStartPre=/bin/bash -c "while [ ! -S /var/run/clamav/clamd.ctl ]; do sleep 1; done"
ExecStart=/usr/bin/clamonacc -F --config-file=/etc/clamav/clamd.conf --log=/var/log/clamav/clamonacc.log --move=/root/quarantine
[Install]
WantedBy=multi-user.target
--
For more info I documented this in a personal blog post here:
https://medium.com/@aaronbrighton/installation-configuration-of-clamav-antivirus-on-ubuntu-18-04-a6416bab3b41?source=friends_link&sk=94fbe7cbab30bee5abfda345b6930c16#a340 Hope this helps.
_______________________________________________
clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq http://www.clamav.net/contact.html#ml