[Pkg-clamav-devel] Bug#941276: clamav-daemon: strange use of systemd service files

Ansgar Burchardt ansgar at debian.org
Fri Sep 27 16:54:45 BST 2019


Package: clamav-daemon
Version: 0.101.4+dfsg-1
Severity: normal

After a user asked something about clamav on IRC, I noticed that
clamav-daemon's postinst creates a file
/etc/systemd/system/clamav-daemon.service.d/extend.conf with static
content:

+---
|     echo "#Automatically Generated by clamav-daemon postinst" > $DEBCONFFILE
|     echo "#To reconfigure clamd run #dpkg-reconfigure clamav-daemon" >> $DEBCONFFILE
|     echo "#Please read /usr/share/doc/clamav-daemon/README.Debian.gz for details" >> $DEBCONFFILE
|     echo "[Service]" > "$DEBSYSTEMDCLAMDCONF"
|     echo "ExecStartPre=-/bin/mkdir /run/clamav" >> "$DEBSYSTEMDCLAMDCONF"
|     echo "ExecStartPre=/bin/chown $User /run/clamav" >> "$DEBSYSTEMDCLAMDCONF"
+---

This really looks like something that doesn't belong in /etc, but
either should be part of clamav-daemon.service directly or shipped as
/lib/systemd/system/clamav-daemon.service.d/extend.conf (i.e. /lib
instead of /etc).

(There is also RuntimeDirectory=, but I'm not sure if stretch's
systemd already supports that.)

For some reason the user had a call to "/bin/mkdir" instead of
"-/bin/mkdir" which failed when the directory already existed (e.g. on
restart).

Ansgar



More information about the Pkg-clamav-devel mailing list