Your message dated Tue, 26 Mar 2019 12:23:23 +0000 with message-id <[email protected]> and subject line Re: [Pkg-clamav-devel] Bug#925475: clamav-freshclam.service is "inactive (dead)" after logrotate postrotate script execution has caused the Debian Bug report #925475, regarding clamav-freshclam.service is "inactive (dead)" after logrotate postrotate script execution to be marked as done.
This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact [email protected] immediately.) -- 925475: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=925475 Debian Bug Tracking System Contact [email protected] with problems
--- Begin Message ---Package: clamav-freshclam Version: 0.100.2+dfsg-0+deb9u1 Severity: important libc6 Version: 2.24-11+deb9u4 systemd Version: 232-25+deb9u9 Debian Version: Debian GNU/Linux 9 (stretch) The `postrotate` script in `/etc/logrotate.d/clamav-freshclam` executes this code if systemd is used: $ cat /etc/logrotate.d/clamav-freshclam postrotate if [ -d /run/systemd/system ]; then systemctl -q is-active clamav-freshclam && systemctl kill --signal=SIGHUP clamav-freshclam || true Whenever logrotate rotates freshclam's logfile, the service is inactive (dead) afterwards. Reproducer: $ systemctl is-active clamav-freshclam active $ systemctl -q is-active clamav-freshclam && systemctl kill --signal=SIGHUP clamav-freshclam || true $ systemctl is-active clamav-freshclam inactive $ systemctl status clamav-freshclam.service ● clamav-freshclam.service - ClamAV virus database updater Loaded: loaded (/lib/systemd/system/clamav-freshclam.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/clamav-freshclam.service.d └─limits.conf Active: inactive (dead) since Mon 2019-03-25 16:28:25 CET; 2s ago Docs: man:freshclam(1) man:freshclam.conf(5) https://www.clamav.net/documents Process: 15231 ExecStart=/usr/bin/cpulimit -f -l 5 -- /usr/bin/freshclam -d --foreground=true (code=killed, signal=HUP) Main PID: 15231 (code=killed, signal=HUP) CPU: 57ms Logrotate for freshclam runs once every week at 06:25. This run was on 2019-03-17, two days later at 2019-03-19 I used my config management to ensure a highstate. During that run freshclam was started - as defined in my states: $ journalctl -x -u clamav-freshclam.service --since 2019-03-16 Mär 17 06:26:06 hostname cpulimit[8290]: Sun Mar 17 06:26:06 2019 -> Update process terminated Mär 19 06:22:52 hostname systemd[1]: Started ClamAV virus database updater. -- Subject: Unit clamav-freshclam.service has finished start-up -- Defined-By: systemd -- Support: https://www.debian.org/support -- -- Unit clamav-freshclam.service has finished starting up. -- -- The start-up result is done. Mär 19 06:22:53 hostname cpulimit[29197]: Tue Mar 19 06:22:53 2019 -> ClamAV update process started at Tue Mar 19 06:22:53 2019 I can just guess, that SIGHUP might be the wrong signal to tell freshclam to re-open its log file. This bug is in so far dangerous, as freshclam will not update clamav's virus definitions anymore. Also clamav-freshclam.service is not failed. Thank you, Nils
--- End Message ---
--- Begin Message ---On March 26, 2019 11:55:12 AM UTC, Nils Fahldieck - Profihost AG <[email protected]> wrote: >Am 25.03.19 um 18:45 schrieb Adam D. Barratt: >> On 2019-03-25 15:39, Nils Fahldieck - Profihost AG wrote: >>> libc6 Version: 2.24-11+deb9u4 >>> systemd Version: 232-25+deb9u9 >>> Debian Version: Debian GNU/Linux 9 (stretch) >>> >>> The `postrotate` script in `/etc/logrotate.d/clamav-freshclam` >executes >>> this code if systemd is used: >>> >>> $ cat /etc/logrotate.d/clamav-freshclam >>> postrotate >>> if [ -d /run/systemd/system ]; then >>> systemctl -q is-active clamav-freshclam && systemctl kill >>> --signal=SIGHUP clamav-freshclam || true >>> >>> Whenever logrotate rotates freshclam's logfile, the service is >inactive >>> (dead) afterwards. >>> >>> Reproducer: >>> >>> $ systemctl is-active clamav-freshclam >>> active >>> $ systemctl -q is-active clamav-freshclam && systemctl kill >>> --signal=SIGHUP clamav-freshclam || true >>> $ systemctl is-active clamav-freshclam >>> inactive >>> $ systemctl status clamav-freshclam.service >>> ● clamav-freshclam.service - ClamAV virus database updater >>> Loaded: loaded (/lib/systemd/system/clamav-freshclam.service; >>> enabled; vendor preset: enabled) >>> Drop-In: /etc/systemd/system/clamav-freshclam.service.d >>> └─limits.conf >>> Active: inactive (dead) since Mon 2019-03-25 16:28:25 CET; 2s ago >>> Docs: man:freshclam(1) >> >> fwiw, I can't reproduce this. >> >> clamav-freshclam 0.100.2+dfsg-0+deb9u1 >> libc6 2.24-11+deb9u4 >> systemd 232-25+deb9u9 >> >> ● clamav-freshclam.service - ClamAV virus database updater >> Loaded: loaded (/lib/systemd/system/clamav-freshclam.service; >> enabled; vendor preset: enabled) >> Active: active (running) since Sun 2019-03-10 19:07:03 GMT; 2 >weeks 0 >> days ago >> .. >> >> -rw-r----- 1 clamav adm 4754 Mar 11 06:25 >> /var/log/clamav/freshclam.log.3.gz >> -rw-r----- 1 clamav adm 3544 Mar 17 06:25 >> /var/log/clamav/freshclam.log.2.gz >> -rw-r----- 1 clamav adm 312142 Mar 24 06:25 >/var/log/clamav/freshclam.log.1 >> -rw-r----- 1 clamav adm 65671 Mar 25 17:25 >/var/log/clamav/freshclam.log >> >> also: >> >> # systemctl is-active clamav-freshclam >> active >> # systemctl -q is-active clamav-freshclam && systemctl kill >> --signal=SIGHUP clamav-freshclam || true >> # systemctl is-active clamav-freshclam >> active >> >> Aaaaaahhh... My guess would be that this is due to your local >> customisation: >> >> Drop-In: /etc/systemd/system/clamav-freshclam.service.d >> └─limits.conf >> ... >> Process: 15231 ExecStart=/usr/bin/cpulimit -f -l 5 -- >> /usr/bin/freshclam -d --foreground=true (code=killed, signal=HUP) >> >> which means that the HUP will be being sent to cpulimit, not to >freshclam. >> >> I'm not a clamav maintainer, but I'd be inclined at this point to say >> that this is not a problem with the package, and "you get to keep the >> pieces", I'm afraid. From a quick bit of research, I would suggest >that >> you want to be using systemd's built-in >> >https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html#CPUQuota= >> , which would entirely avoid this issue. >> >> Regards, >> >> Adam > >Hi Adam, > >thank you very much for your answer and your time. You've guided me in >the right direction. In fact cpulimit receives the SIGHUP, which kills >the whole Cgroup of clamav-freshclam. > >Regarding your suggestion to use CPUQuota: I will look more into >systemd's own options and use them the next time round. > >So this is *not* a bug in clamav-freshclam package. I'm very sorry for >this false bug report. > Thanks for the update. Closing. Scott K
--- End Message ---
_______________________________________________ Pkg-clamav-devel mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-clamav-devel
