Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Systemd timer for freshclam updates #962

Merged
merged 1 commit into from
Aug 3, 2023

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

@micahsnyder micahsnyder 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

@micahsnyder micahsnyder 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