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

Sebastian Andrzej Siewior sebastian at breakpoint.cc
Sun Nov 1 18:43:33 GMT 2020


On 2019-09-27 17:54:45 [+0200], Ansgar Burchardt wrote:
> Package: clamav-daemon
> Version: 0.101.4+dfsg-1
> Severity: normal

I'm sorry but have to admit that this somehow fell through the cracks.

> 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.)

I will have to look that up. The user may change from the default so it
is autogenerated. If you say that this should be in /lib then I will try
to make that happen.

> 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).

In the meantime we have "mkdir -p" in unstable which should address
this. I will try to to bring this change to stable.

> Ansgar

Sebastian



More information about the Pkg-clamav-devel mailing list