Skip to content
This repository was archived by the owner on Oct 7, 2025. It is now read-only.

Commit 02efd73

Browse files
authored
Merge pull request #2464 from codeenigma/Systemd-overrides-clamav-daemon-PR-2.x
Systemd overrides clamav daemon pr 2.x
2 parents 5955cb8 + ecbcfdc commit 02efd73

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- name: Restart clamav-daemon.socket
2+
ansible.builtin.service:
3+
name: clamav-daemon.socket
4+
state: restarted
5+
enabled: true

roles/debian/clamav/tasks/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,13 @@
4141
pkg: clamdscan
4242
state: present
4343
when: clamav.install_clamdscan
44+
45+
- name: Clamav daemon socket overrides
46+
ansible.builtin.template:
47+
src: clamav-daemon.socket.j2
48+
dest: /etc/systemd/system/clamav-daemon.socket
49+
mode: '0644'
50+
when: clamav_daemon_enabled
51+
notify:
52+
- reload systemd
53+
- Restart clamav-daemon.socket
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[Unit]
2+
Description=Socket for Clam AntiVirus userspace daemon
3+
Documentation=man:clamd(8) man:clamd.conf(5) https://docs.clamav.net/
4+
# Check for database existence
5+
ConditionPathExistsGlob=/var/lib/clamav/main.{c[vl]d,inc}
6+
ConditionPathExistsGlob=/var/lib/clamav/daily.{c[vl]d,inc}
7+
8+
[Socket]
9+
ListenStream=/run/clamav/clamd.ctl
10+
ListenStream=3310
11+
SocketUser=clamav
12+
SocketGroup=clamav
13+
RemoveOnStop=True
14+
15+
[Install]
16+
WantedBy=sockets.target

0 commit comments

Comments
 (0)