On Sun, 13 Mar 2022 00:07:06 +0000, Simon McVittie wrote:
>> These are still somewhat annoying in practice because of the log entries for
>> CRON running something pointlessly.
>
>systemd-cron gets round this by assuming that /etc/cron.d/foobar
>is redundant with a native systemd timer foobar.timer, so if
>foobar.timer exists (or is explicitly masked), systemd-cron will not run
>/etc/cron.d/foobar. I don't think this naming convention is formally
>guaranteed by Policy, but it seems to work well enough in practice.
>
>systemd-cron is a third-party implementation of the cron-daemon interface
>as a systemd generator, which outputs pairs of systemd .timer and
>.service units corresponding to cron jobs. It is not part of systemd,
>and is an alternative to running a more traditional cron-daemon (Vixie
>cron or equivalent) as a long-running systemd service.
>
>This mechanism currently only works for cron.d, and not for the grouped
>hourly/daily/weekly/monthly sets of cron jobs, which always get run
>by run-parts (unless the corresponding directory is completely empty,
>in which case the appropriate hourly/daily/weekly/monthly timer is
>automatically disabled by a ConditionDirectoryNotEmpty rule).
>
> ... https://lists.debian.org/debian-devel/2022/03/msg00211.html

Hi, I want to change this part for the Trixie cycle;
I just uploaded a new systemd-cron right now.

The needed "part" name to timer "name" translation table
has been included in the upstream repos. There will certainly a lot
a cases missing ... a smarter idea is welcomed
(the easiest on my side is to ask packages to always use
same name for /etc/cron.*/<name> and <name>.timer)

To do nothing faster systemd-cron could/should be rewritten in C/C++.

> # this is dumb, but gets the job done ... for now
>PART2TIMER = {
>    'apt-compat': 'apt-daily',
>    'dpkg': 'dpkg-db-backup',
>    'plocate': 'plocate-updatedb',
>}

systemd-cron (1.15.21-1) unstable; urgency=low

  * do not use "run-parts" anymore to execute /etc/cron.{hourly|weekly|monthly}
    and instead generate a .timer+.service pair by item.
    Most prominent Debian packages already provide their own .timer:
    apt, dpkg, man-deb, plocate ... in this case systemd-cron does nothing.

Reply via email to