Bug#1106000: systemd-cron: purging "anacron" after systemd-cron will publish message with level 'error' on journal, once

наб nabijaczleweli at nabijaczleweli.xyz
Sun May 18 20:34:12 BST 2025


Control: reassign -1 anacron 2.3-42
Control: tags -1 + patch
Control: forwarded -1 https://salsa.debian.org/debian/anacron/-/merge_requests/8

Can repro this on
  a fresh trixie install
+ apt install anacron
+ apt install systemd-cron [this removes cron anacron]
=> $ systemctl list-timers | grep cron
   Sun 2025-05-18 21:30:00 CEST    45min -         - cron-anacron-root-0.timer    cron-anacron-root-0.service
   Mon 2025-05-19 00:15:00 CEST 3h 30min -         - systemd-cron-cleaner.timer   systemd-cron-cleaner.service
   $ cat /run/systemd/generator/cron-anacron-root-0.sh
   [ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi
=> when it's triggered (I did it manually)
   $ systemctl status cron-anacron-root-0.service
        Loaded: loaded (/etc/cron.d/anacron; generated)
        Active: failed (Result: exit-code) since Sun 2025-05-18 20:46:21 CEST; 25s ago
    Invocation: a5fb0a030354471cba6e865266d87858
   TriggeredBy: ● cron-anacron-root-0.timer
          Docs: man:systemd-crontab-generator(8)
       Process: 1220 ExecStart=/bin/sh /run/systemd/generator/cron-anacron-root-0.sh (code=exited, status=1/FAILURE)
      Main PID: 1220 (code=exited, status=1/FAILURE)
      Mem peak: 1.7M
           CPU: 20ms
   
   May 18 20:46:21 trixie systemd[1]: Starting cron-anacron-root-0.service - [Cron] "30 7-23 * * *   root        [ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi"...
   May 18 20:46:21 trixie systemd[1]: cron-anacron-root-0.service: Main process exited, code=exited, status=1/FAILURE
   May 18 20:46:21 trixie systemd[1]: cron-anacron-root-0.service: Failed with result 'exit-code'.
   May 18 20:46:21 trixie systemd[1]: Failed to start cron-anacron-root-0.service - [Cron] "30 7-23 * * *   root        [ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi".

I put it to you that this is actually an anacron bug in the cronjob,
since this would happen with /any/ cron implementation when anacron=rc,
and the cronjob needs to check for if anacron actually exists
(or ignore the error stronger, or change the logic some other way?).

...or apparently /etc/init.d/anacron (and /cron)
becomes 644 instead of 755 on removal?

So it wants to put the [ -x condition into the if, which will mean that
the program won't fail if the [ -x condition fails.
I've validated this to hold.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/x-diff
Size: 1587 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20250518/0f55d61a/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20250518/0f55d61a/attachment.sig>


More information about the Pkg-systemd-maintainers mailing list