[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: migration from cron.daily to systemd timers



Am Mittwoch, den 08.01.2020, 17:23 -0500 schrieb Noah Meyerhans:
> On Wed, Jan 08, 2020 at 10:32:07PM +0100, Philip Hands wrote:
> > I don't really care what that comment says, as that's up to the
> > maintainer of the package, and how they intend to deal with this in the
> > future, but I'm really not a fan adding unnecessary questions to debconf.
> 
> Here's my proposal for how to perform this conversion:
> 
> https://salsa.debian.org/noahm/spamassassin/commit/2b2020cbd2e43361d93d8efc1304f5575c0a83e1
> 
> If CRON=0, as is the default, then the cron.daily script is a no-op, as
> today, under systemd or non-systemd.
> 
> If CRON=1 and non systemd, then the cron.daily script performs the
> maintenance as today.
> 
> If systemd and CRON=1 and the systemd time is enabled, then the
> cron.daily script is a no-op.
> 
> If systemd and CRON=1 and the timer is disabled, then then:
> 
>    a. If the administrator has created a file named
>       /etc/spamassassin/skip-timer-conversion, then the cron script will
>       perform the daily maintenance tasks.
>    b. If there is no /etc/spamassassin/skip-timer-conversion file, then
>       the cron script will enable the timer, run a single invocation of
>       the maintenance task, and exit.  Future invocations of the
>       cron.daily script are no-op, as described above, due to the timer
>       being enabled.
> 
> I find the /etc/spamassassin/skip-timer-conversion file a little clunky,
> but I doubt that most people are going to bother with it, and it
> provides the flexibility to choose not to switch to the timer.

Why not simply introduce a non-Cron-related variable in
/etc/default/spamassassin like ENABLE_UPDATES and add it to the new
configuration file. You can even remove the CRON variable from the shipped
configuration file. This variable should take precendence over CRON if both are
enabled. This would have the advantage of not polluting the meaning of CRON. It
lets the user decide at install time, how to proceed (and if to keep the
previous behavior), it would ship a new default like you seem to wish, and it
would realize the suggestion by Philip. There is IMHO no need to create another
file.

Daniel

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: