Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: FYI: Daily / weekly / monthly cron jobs run twice on DST - non-DST transition
Date: Sun, 05 Nov 2017 19:23:03
Message-Id: CAGfcS_mJ3tS4KzD4=swTzbr3HAeLn+CfoBUViz0+XoLQN-pbwA@mail.gmail.com
In Reply to: [gentoo-user] Re: FYI: Daily / weekly / monthly cron jobs run twice on DST - non-DST transition by Ian Zimmerman
1 On Sun, Nov 5, 2017 at 8:10 AM, Ian Zimmerman <itz@××××××××××××.org> wrote:
2 > On 2017-11-05 07:11, Rich Freeman wrote:
3 >
4 >> But, I agree that it makes far more sense to just have desktop users
5 >> use an appropriate cron implementation designed to handle the machine
6 >> being off most of the time vs trying to use shell scripting to make
7 >> vixie cron into such an implementation.
8 >>
9 >> FWIW this is probably the reasoning behind including cron-like
10 >> functionality in systemd, and having it support optionally running
11 >> jobs if the system was down during a calendar-based event. It was
12 >> considered bare-bones functionality that any desktop or generic server
13 >> would need.
14 >
15 > If Kai is right that fcron handles it, the reason is probably systemd
16 > people thought that had to match the functionality to be considered a
17 > full replacement. Especially since fcron is the normal system cron on
18 > Fedora/RH, right?
19
20 Honestly, I think it is more because it is almost impossible to cover
21 both desktops and servers without these features, so there is little
22 point in adding timers if you don't support both. The reason they're
23 there at all is because it falls into "core functionality" which is a
24 goal of systemd - it is a bit like busybox in that regard (and, indeed
25 busybox also implements a crond).
26
27 However, while systemd aims to go further than busybox it doesn't
28 actually aim to replace all the other tools that it overlaps with.
29 For example, resolved isn't a full substitute for bind, and timesyncd
30 isn't a full substitute for ntp (the latter of which is relatively
31 popular on random systems and not just dedicated servers). In general
32 they try to focus on the client-side stuff only, with a moderate but
33 not minimal scope.
34
35 >
36 >> I personally use systemd-cron which basically is a wrapper+generator
37 >> around /etc/crontab and the various /etc/cron.*/ scripts.
38 >
39 > If your dislike for having this in cron itself comes down to shell
40 > script vs. C code, and it appears so from the above, I'm not at all sure
41 > I agree. This to me seems one of the few tasks where shell script is in
42 > fact a good fit: mainly looking at files, timestamps, and running other
43 > programs.
44
45 So, two things here:
46
47 First, I'm honestly not sure I buy that shell scripts are the best
48 tool here. Yes, they can look at files and timestamps, but I tend to
49 be of the school that shell scripts are poor environments to write
50 actual software in. At best they work reasonably well for glue. I'm
51 not advocating for C, but if I were implementing a cron I wouldn't be
52 doing it in bash.
53
54 Second, my actual objection is more to sticking wrappers around an
55 upstream program just to extend its capabilities, when other software
56 is maintained upstream that already does what you're re-inventing.
57 When you already have 47 different cron implementations out there, I'm
58 not sure it adds a lot to have a distro-specific solution. The distro
59 should certainly be providing stuff like /etc/cron.*/ and the scripts
60 inside when upstream isn't providing them. By all means include a
61 stock wrapper /etc/crontab that runs that stuff at set times for those
62 running 24x7 with vixie cron. If run-scripts was implemented in
63 python instead of shell this objection wouldn't go away.
64
65 Sure, back in the early days of Gentoo maybe it made a little more
66 sense to have our own tools just like everybody else did, and I'm not
67 sure I'd advocate to go removing them either. However, I can
68 certainly sympathize with WONTFIX when people want to continue to add
69 features to them. They're just a minimal starting point that is
70 implementation-agnostic - use the right tool if your requirements
71 exceed these.
72
73
74 --
75 Rich

Replies

Subject Author
[gentoo-user] Re: FYI: Daily / weekly / monthly cron jobs run twice on DST - non-DST transition Ian Zimmerman <itz@××××××××××××.org>