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

Re: Favoring systemd timers over cron files Re: Removing sysV init files



Le vendredi 15 janvier 2016, 21:58:18 Anthony DeRobertis a écrit :
> On 01/15/2016 09:29 PM, Jens Reyer wrote:
> > Does this also work somehow for e.g. foo-daily.service + 
> > foo-daily.timer being favored over /etc/cron.daily/foo? Next to a 
> > foo.service being favored over /etc/init.d/foo. Thanks and greets jre 

Hi,

systemd-cron does that:

https://sources.debian.net/src/systemd-cron/1.5.3-1/src/bin/systemd-crontab-generator.py/#L473

I also wrote a proposal for the policy here:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770440

The only thing that systemd-cron needs to close last remaining bugs
is a rewrite in a lower level language with a smaller runtime
(C or C++) there's a rewrite done in Rust; butI have no
idea on how to package that in Debian & the runtime is huge.

That's only about 550 lines of python code to rewrite that
read some textfiles in /etc/cron.d (crontabs)
& output other text files in /run (systemd timers & service);
I'll do that "someday".

Then crontab would need to be spun out of cron.deb so that
it could be shared by two implementations.

> No, it won't work automatically. Cron doesn't look at systemd units. 

Vixie cron could be patched to also work this way to avoid noise in log files.

> You could of course put something like this at the top of your 
> /etc/cron.daily/foo:
> 
>     if [ -d /run/systemd/system ]; then
>          exit 0;
>     fi
> 


Reply to: