# rpm -q centos-release
centos-release-7-5.1804.el7.centos.2.x86_64
# rpm -qa clam
clamav-filesystem-0.100.0-2.el7.noarch
clamav-data-0.100.0-2.el7.noarch
clamav-lib-0.100.0-2.el7.x86_64
clamav-update-0.100.0-2.el7.x86_64
clamav-server-systemd-0.100.0-2.el7.x86_64
clamav-devel-0.100.0-2.el7.x86_64
clamav-scanner-systemd-0.100.0-2.el7.x86_64
clamd-0.100.0-2.el7.x86_64
clamav-0.100.0-2.el7.x86_64
En dessous de clamd@.service
en l'état.
# cat /usr/lib/systemd/system/clamd\@.service
[Unit]
Description = clamd scanner (%i) daemon
After = syslog.target nss-lookup.target network.target
[Service]
Type = forking
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf
Restart = on-failure
J'utilise la configuration standard avec les paramètres par défaut.
# /etc/clamd.d/mail.conf
LogSyslog yes
TCPSocket 3310
TCPAddr 127.0.0.1
User clamscan
commencer
Après le démarrage, aucune erreur
# systemctl start clamd@mail
09:02:35 -- clamd[3644]: Limits: Global size limit set to 104857600 bytes.
09:03:39 -- clamd[3664]: Received 0 file descriptor(s) from systemd.
09:03:39 -- clamd[3664]: clamd daemon 0.100.0 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
09:03:39 -- clamd[3664]: Running as user clamscan (UID 992, GID 989)
09:03:39 -- clamd[3664]: Log file size limited to 1048576 bytes.
09:03:39 -- clamd[3664]: Reading databases from /var/lib/clamav
09:03:39 -- clamd[3664]: Not loading PUA signatures.
09:03:39 -- clamd[3664]: Bytecode: Security mode set to "TrustSigned".
09:04:01 -- clamd[3664]: Loaded 6575820 signatures.
09:04:08 -- clamd[3664]: TCP: Bound to [127.0.0.1]:3310
09:04:08 -- clamd[3664]: TCP: Setting connection queue length to 200
statut
# systemctl status clamd@mail
clamd@rspamd.service - clamd scanner (rspamd) daemon
Loaded: loaded (/usr/lib/systemd/system/clamd@.service; static; vendor preset: disabled)
Active: inactive (dead)
# lsof -i | grep 3310
Empty
Il semble que le service n'ait pas été exécuté en tant que démon. J'ai essayé d'éditer le fichier /usr/lib/systemd/system/clamd@.service
mais n'a pas obtenu le résultat escompté (il redémarre toujours).
[Service]
Type = simple
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf --foreground=yes
Restart = on-failure