Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] rfc: cron.* and modern cron implementations
Date: Sun, 03 Mar 2019 02:02:05
Message-Id: CAGfcS_=fQ21Xm1Q0QNq6-o=CuRC+4TXX4DmMUASJQgSY6jSimg@mail.gmail.com
In Reply to: Re: [gentoo-dev] rfc: cron.* and modern cron implementations by Michael Orlitzky
1 On Sat, Mar 2, 2019 at 8:25 PM Michael Orlitzky <mjo@g.o> wrote:
2 >
3 > Using run-parts in /etc/crontab also has its problems, but I don't have
4 > a solution handy for that one. Using run-parts runs those daily, weekly,
5 > etc. jobs as root, which may not be what you want if you're operating on
6 > user-controlled data (e.g. bug 662438). The best way to solve this would
7 > be to let packages install their own crontab entries into a directory
8 > like /etc/cron.d, but that location isn't standard.
9 >
10
11 So, the problem with cron.d is that you're now using crontab syntax,
12 and for compatibility you have to use the lowest common denominator
13 which is vixie.
14
15 That means your jobs are STILL running as root, so the only problem
16 you had with run-parts isn't solved.
17
18 In addition you lose the ability to cover the desktop use case of
19 non-24x7 systems running infrequent tasks. If you used vixie cron
20 syntax for a monthly job it might never run at all on a typical
21 desktop, as it would have one opportunity to run in a month, at one
22 time of day.
23
24 The crontab syntax also forces each package maintainer to pick the
25 time of day their jobs run at, vs just letting the sysadmin choose the
26 time the entire set of scripts is run.
27
28 I'm sure there are alternatives like adding a compatibility layer
29 (which is basically what run-crons already is), or some kind of helper
30 where an ebuild can give it a set of parameters and it installs the
31 task for whatever cron implementation eselect points it at. I'm just
32 not sure that they are worth the complexity or provide much more value
33 than the existing solutions. This is also somewhat orthogonal to
34 run-crons, where you still are left with the choice around whether to
35 use it with vixie or other implementations that don't support more
36 desktop-oriented use cases.
37
38 This is of course why that bug has been fairly intractable.
39
40 --
41 Rich

Replies

Subject Author
Re: [gentoo-dev] rfc: cron.* and modern cron implementations Michael Orlitzky <mjo@g.o>