Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#767353: clamav: ERROR: Can't save PID to file /var/run/clamav/freshclam.pid: No such file or directory

349 views
Skip to first unread message

Santiago Vila

unread,
Oct 30, 2014, 8:30:04 AM10/30/14
to
Package: clamav
Version: 0.98.5~rc1+dfsg-2
Severity: serious

The subject says it all. This may affect the ability of sysvinit to
start or stop the process (but I may be wrong), hence the serious severity.

Thanks.


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Andreas Cadhalpun

unread,
Oct 30, 2014, 12:30:04 PM10/30/14
to
Control: severity -1 normal

Hi Santiago,

On 30.10.2014 13:23, Santiago Vila wrote:
> The subject says it all. This may affect the ability of sysvinit to
> start or stop the process (but I may be wrong), hence the serious severity.

Clamav-freshclam works fine under sysvinit and thus I'm reducing the
severity of this bug.

In fact, this error message only appears when the init system is systemd
and it is totally harmless in that case.

If you want to get rid of this message, you can remove the PidFile line
from /etc/clamav/freshclam.conf.
However, be warned that if you do this, clamav-freshclam won't start
anymore with sysvinit as PID 1.

Best regards,
Andreas

Sebastian Andrzej Siewior

unread,
Oct 30, 2014, 5:00:03 PM10/30/14
to
* Andreas Cadhalpun | 2014-10-30 17:20:55 [+0100]:

>Hi Santiago,
Hi Andreas,

>On 30.10.2014 13:23, Santiago Vila wrote:
>>The subject says it all. This may affect the ability of sysvinit to
>>start or stop the process (but I may be wrong), hence the serious severity.
>
>In fact, this error message only appears when the init system is systemd and
>it is totally harmless in that case.
>
>If you want to get rid of this message, you can remove the PidFile line from
>/etc/clamav/freshclam.conf.

I don't get it. Is systemd taking care of writing the PID file or is it
not used at all? And why can't freshclam wite its PID file like it does
with systemv?

>
>Best regards,
>Andreas

Sebastian

Andreas Cadhalpun

unread,
Oct 30, 2014, 5:20:03 PM10/30/14
to
Hi Sebastian,

On 30.10.2014 21:55, Sebastian Andrzej Siewior wrote:
> I don't get it.

Then let me try to explain it in more detail. ;)

> Is systemd taking care of writing the PID file

No.

> or is it not used at all?

It's not used, because freshclam is run in foreground mode, i.e. it
doesn't fork and thus tracking the PID via a file is not necessary.

> And why can't freshclam wite its PID file like it does
> with systemv?

It can only write the file if the directory exists.
The sysv init script creates the directory, but since it is not
necessary for systemd, the service file does not create the directory.

The service file could also create this directory, however that's not
straight forward in this case, because the PidFile path can be changed
in the freshclam.conf file. Thus the service unit would have to parse
that file and as it is not a simple shell snippet with 'Key=Value'
entries, but rather contains 'Key Value' lines, one cannot directly use
it as EnvironmentFile in the service unit.

As this warning is completely harmless, when systemd is used, I don't
think it's worth to invest a lot of time trying to fix this.

But if someone finds a simple solution, it can be applied.

Best regards,
Andreas

Milko Krachounov

unread,
Jan 18, 2015, 6:10:04 AM1/18/15
to
On Friday, 30 October 2014 22:14:46 you wrote:
> As this warning is completely harmless, when systemd is used, I don't
> think it's worth to invest a lot of time trying to fix this.

It is not completely harmless---it breaks logrotate for me. Logrotate
fails to reload the daemon after rotating the logs, and it spams my
mailbox with errors.

/etc/cron.daily/logrotate:
pkill: pidfile not valid
Try `pkill --help' for more information.


And when running the post-rotate command that's in
/etc/logrotate.d/clamav-freshclam I get the following:

# /etc/init.d/clamav-freshclam reload-log
[....] Reloading ClamAV virus database updater: freshclampkill: pidfile not valid
Try `pkill --help' for more information.
failed!
signature.asc

Andreas Cadhalpun

unread,
Jan 20, 2015, 7:10:03 PM1/20/15
to
Control: tags -1 pending

Hi Milko,

On 18.01.2015 11:53, Milko Krachounov wrote:
> On Friday, 30 October 2014 22:14:46 you wrote:
>> As this warning is completely harmless, when systemd is used, I don't
>> think it's worth to invest a lot of time trying to fix this.
>
> It is not completely harmless---it breaks logrotate for me. Logrotate
> fails to reload the daemon after rotating the logs, and it spams my
> mailbox with errors.

Indeed logrotate doesn't work correctly under systemd. Thanks for noticing.

> /etc/cron.daily/logrotate:
> pkill: pidfile not valid
> Try `pkill --help' for more information.
>
>
> And when running the post-rotate command that's in
> /etc/logrotate.d/clamav-freshclam I get the following:
>
> # /etc/init.d/clamav-freshclam reload-log
> [....] Reloading ClamAV virus database updater: freshclampkill: pidfile not valid
> Try `pkill --help' for more information.
> failed!

However, I would argue that the problem is not so much the missing pid
file, but rather that the logrotate script calls the sysvinit script
even under systemd.

I fixed this now in git [1].
To workaround this problem until the next regular clamav upload, you can
apply the same changes to your /etc/logrotate.d/clamav-{daemon,freshclam}.

While at it, I also fixed the error message, this bug is about [2].

Best regards,
Andreas

1:
https://anonscm.debian.org/cgit/pkg-clamav/clamav.git/commit/?id=0f68bb22ef0e7cfa8732dd558557593456a15861
2:
https://anonscm.debian.org/cgit/pkg-clamav/clamav.git/commit/?id=3f3ec5509a15b85bf74fac11cecab1c5272956b0
0 new messages