Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions roles/debian/clamav/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- name: Restart clamav-daemon.socket
ansible.builtin.service:
name: clamav-daemon.socket
state: restarted
enabled: true
10 changes: 10 additions & 0 deletions roles/debian/clamav/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@
pkg: clamdscan
state: present
when: clamav.install_clamdscan

- name: Clamav daemon socket overrides
ansible.builtin.template:
src: clamav-daemon.socket.j2
dest: /etc/systemd/system/clamav-daemon.socket
mode: '0644'
when: clamav_daemon_enabled
notify:
- reload systemd
- Restart clamav-daemon.socket
16 changes: 16 additions & 0 deletions roles/debian/clamav/templates/clamav-daemon.socket.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[Unit]
Description=Socket for Clam AntiVirus userspace daemon
Documentation=man:clamd(8) man:clamd.conf(5) https://docs.clamav.net/
# Check for database existence
ConditionPathExistsGlob=/var/lib/clamav/main.{c[vl]d,inc}
ConditionPathExistsGlob=/var/lib/clamav/daily.{c[vl]d,inc}

[Socket]
ListenStream=/run/clamav/clamd.ctl
ListenStream=3310
SocketUser=clamav
SocketGroup=clamav
RemoveOnStop=True

[Install]
WantedBy=sockets.target
Loading