Skip to content

Conversation

@nils-werner
Copy link
Contributor

@nils-werner nils-werner commented Jun 23, 2023

This PR implements a systemd unit that updates freshclam once, without sending freshclam into the background.

It comes with a systemd timer which, when activated, will call this unit periodically. This takes the "burden of timing the updates" off of freshclam and puts it onto systemd. The timer can then easily activated, audited and the logs inspected:

sudo systemctl enable --now clamav-freshclam-once.timer
sudo systemctl list-timers
sudo systemctl status clamav-freshclam-once.timer
sudo systemctl status clamav-freshclam-once.service
journalctl -u clamav-freshclam-once.service

And if you want a different update interval you can edit the timer unit file using

sudo systemctl edit clamav-freshclam-once.timer

Copy link
Contributor

@val-ms val-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change makes sense to me. And the code looks good as far as I can tell.

I tested on an ubuntu 22.04 VM with

systemctl enable clamav-freshclam-once.timer
systemctl start clamav-freshclam-once
systemctl status clamav-freshclam-once

It seemed to work okay.

Would you be interested in helping write some documentation for setting enabling the systemd freshclam, clamd, and maybe clamonacc services?
The documentation page would be here https://github.com/Cisco-Talos/clamav-documentation/blob/main/src/manual/Usage/Services.md

This source backs https://docs.clamav.net/manual/Usage/Services.html

A related PR: #859

@val-ms val-ms merged commit 4d26bc6 into Cisco-Talos:main Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants