Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662196 - app-antivirus/clamav-0.100.1 systemd: possible duplication of systemd service files
Summary: app-antivirus/clamav-0.100.1 systemd: possible duplication of systemd service...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Antivirus Team
URL:
Whiteboard:
Keywords:
: 670731 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-07-26 19:08 UTC by Dennis Lamm
Modified: 2023-02-17 05:18 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Lamm gentoo-dev 2018-07-26 19:08:00 UTC
Currently there are the two systemd service files
- clamav-daemon.service
- clamav-freshclam.service
upstream available.
Also are custom service files 
- clamd.service
- freshclamd.service
from the ebuild available.
Comment 1 Thomas Raschbacher gentoo-dev 2018-10-14 11:56:50 UTC
adding the systemd team to it

If someone could have a look and let me know if the upstream files are better/suitable/.. please let me know - if not then I'll try to have a look at some point soon
Comment 2 Wolfram Schlich 2018-11-09 07:23:10 UTC
*** Bug 670731 has been marked as a duplicate of this bug. ***
Comment 3 Wolfram Schlich 2018-11-09 07:23:34 UTC
(In reply to Thomas Raschbacher from comment #1)
> adding the systemd team to it
> 
> If someone could have a look and let me know if the upstream files are
> better/suitable/.. please let me know - if not then I'll try to have a look
> at some point soon

See my comment in my duplicate bug #662196:

(In reply to Wolfram Schlich from comment #0)
> app-antivirus/clamav-0.100.2 installs 2 systemd units for clamd:
> 
> /lib/systemd/system/clamd.service
> /lib/systemd/system/clamav-daemon.service
> 
> clamd.service seems to be the one that should be killed as it forks clamd in
> the background (not systemds philosophy) and it's also not related to
> clamav-daemon.socket (but clamav-daemon.service is).
Comment 4 Thomas Raschbacher gentoo-dev 2019-02-22 20:22:54 UTC
would appreciate if someone who is familiar with systemd could look into this (see the comment on bug #670731)
Comment 5 zshzero 2020-01-14 08:13:07 UTC
Yes, there are duplicate service files

2731 root      20   0   10792   3608   3140 R   0.0   0.1   0:03.32 top
2681 clamav    20   0   16040   4136   3196 S   0.0   0.1   0:00.00 freshclam
2716 clamav    20   0  959828 824544      0 S   0.0  21.4   0:00.00 clamd
2722 clamav    20   0  959824 834112   9576 S   0.0  21.7   0:34.90 clamd
2726 clamav    20   0   16148   8420   7444 S   0.0   0.2   0:00.00 freshclam

And their service files are

-> clamav-daemon.service

[Unit]
Description=Clam AntiVirus userspace daemon
Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/
Requires=clamav-daemon.socket
# Check for database existence
ConditionPathExistsGlob=/var/lib/clamav/main.{c[vl]d,inc}
ConditionPathExistsGlob=/var/lib/clamav/daily.{c[vl]d,inc}

[Service]
ExecStart=/usr/sbin/clamd --foreground=true
# Reload the database
ExecReload=/bin/kill -USR2 $MAINPID
StandardOutput=syslog

[Install]
WantedBy=multi-user.target
Also=clamav-daemon.socket

-> clamd.service

[Unit]
Description=clamd scanner daemon
After=nss-lookup.target network.target

[Service]
Type=forking
ExecStart=/usr/sbin/clamd
Restart=on-failure
PrivateTmp=true

[Install]
WantedBy=multi-user.target

And

-> clamav-freshclam.service

[Unit]
Description=ClamAV virus database updater
Documentation=man:freshclam(1) man:freshclam.conf(5) https://www.clamav.net/documents
# If user wants it run from cron, don't start the daemon.
ConditionPathExists=!/etc/cron.d/clamav-freshclam

[Service]
ExecStart=/usr/bin/freshclam -d --foreground=true
StandardOutput=syslog

[Install]
WantedBy=multi-user.target

--> freshclamd.service

[Unit]
Description=clamav updater

[Service]
Type=forking
User=clamav
Group=clamav
RuntimeDirectory=clamav
PIDFile=/run/clamav/freshclam.pid
ExecStart=/usr/bin/freshclam -d -p /run/clamav/freshclam.pid

[Install]
WantedBy=multi-user.target