I have experienced the same problem with systemd repeatedly trying to start
the daemon. Every ~300 μsec for about four hours makes for 71+ million lines
of syslog. 

 As I see the problem, systemd does not consider the clamav-daemon service
as failed, when the preconditions are not met. Thus, it will repeatedly
attempt to start the service unit, when the socket is used. To get around
this problem, I've moved[1] ConditionPathExistsGlob from the .service unit
to the .socket unit. By moving the check to the top of the chain, it appears
that systemd will not go into an endless loop, trying to fullfill the
requirements, that are un-fullfillable.


1. Attached patch: clamav-0.98.7-systemdunit.patch
-- 
//Wegge
diff -uwr --unidirectional-new-file clamav-0.98.7+dfsg.orig/clamd/clamav-daemon.service.in clamav-0.98.7+dfsg/clamd/clamav-daemon.service.in
--- clamav-0.98.7+dfsg.orig/clamd/clamav-daemon.service.in	2015-05-06 22:33:56.000000000 +0200
+++ clamav-0.98.7+dfsg/clamd/clamav-daemon.service.in	2015-05-06 22:49:26.000000000 +0200
@@ -2,9 +2,6 @@
 Description=Clam AntiVirus userspace daemon
 Documentation=man:clamd(8) man:clamd.conf(5) http://www.clamav.net/lang/en/doc/
 Requires=clamav-daemon.socket
-# Check for database existence
-ConditionPathExistsGlob=@DBDIR@/main.{c[vl]d,inc}
-ConditionPathExistsGlob=@DBDIR@/daily.{c[vl]d,inc}
 
 [Service]
 ExecStart=@prefix@/sbin/clamd --foreground=true
Only in clamav-0.98.7+dfsg.orig/clamd: clamav-daemon.socket
diff -uwr --unidirectional-new-file clamav-0.98.7+dfsg.orig/clamd/clamav-daemon.socket.in clamav-0.98.7+dfsg/clamd/clamav-daemon.socket.in
--- clamav-0.98.7+dfsg.orig/clamd/clamav-daemon.socket.in	1970-01-01 01:00:00.000000000 +0100
+++ clamav-0.98.7+dfsg/clamd/clamav-daemon.socket.in	2015-05-06 22:49:23.000000000 +0200
@@ -0,0 +1,16 @@
+[Unit]
+Description=Socket for Clam AntiVirus userspace daemon
+Documentation=man:clamd(8) man:clamd.conf(5) http://www.clamav.net/lang/en/doc/
+# Check for database existence
+ConditionPathExistsGlob=@DBDIR@/main.{c[vl]d,inc}
+ConditionPathExistsGlob=@DBDIR@/daily.{c[vl]d,inc}
+
+[Socket]
+ListenStream=/run/clamav/clamd.ctl
+#ListenStream=127.0.0.1:1024
+SocketUser=clamav
+SocketGroup=clamav
+RemoveOnStop=True
+
+[Install]
+WantedBy=sockets.target
_______________________________________________
Pkg-clamav-devel mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-clamav-devel

Reply via email to