1 |
On 7/7/07, Mike Frysinger <vapier@g.o> wrote: |
2 |
> On Sunday 01 July 2007, Ryan Reich wrote: |
3 |
> > This is a small essay on Gentoo's setup for fcron. |
4 |
> |
5 |
> which is troublesome because some of the things here are specific to fcron |
6 |
> (which frankly dont interest me) while others are specific to the cronbase |
7 |
> package which installs `run-crons` (which does interest me as it is a |
8 |
> Gentooism) ... i'll try to pick out only the relevant pieces as you said |
9 |
> yourself, the fcron things should go upstream. |
10 |
|
11 |
I'm sorry you don't care about my fcron criticisms, but that's the |
12 |
cron I use so it's the one I picked on. The problems with |
13 |
check_system_crontabs were only half the point, anyway. |
14 |
|
15 |
> > 2. is implmented by putting the following rules in /etc/crontab: |
16 |
> > 0 * * * * rm -f /var/spool/cron/lastrun/cron.hourly |
17 |
> > 1 3 * * * rm -f /var/spool/cron/lastrun/cron.daily |
18 |
> > 15 4 * * 6 rm -f /var/spool/cron/lastrun/cron.weekly |
19 |
> > 30 5 1 * * rm -f /var/spool/cron/lastrun/cron.monthly |
20 |
> > */10 * * * * /usr/bin/test -x /usr/sbin/run-crons && |
21 |
> > /usr/sbin/run-crons |
22 |
> > whose effect is, at intevals of one hour, day, week, and month, to |
23 |
> > remove some state files for the script run-crons, and also to run said |
24 |
> > script every ten minutes. The purpose of run-crons is to run the |
25 |
> > scripts in /etc/cron.{hourly,...} at the appropriate intervals, thus |
26 |
> > saving me the effort of adding a lot of lines looking like |
27 |
> > 1 3 * * * * some-command |
28 |
> > to my crontab. |
29 |
> |
30 |
> you missed a critical aspect: offline time. the way run-crons is implemented, |
31 |
> if you happen to routinely shut your machine off at the time that the cronjob |
32 |
> is supposed to fire, then the standard you proposed will pretty much never |
33 |
> fire. the run-crons implementation however has a pretty good guarantee that |
34 |
> the periodic crons will get fired at the next uptime opportunity. |
35 |
|
36 |
This point is where your uninterest in fcron puts us at odds. See, |
37 |
fcron allows you to have such commands run at boot, and allows you to |
38 |
schedule commands that run at periods of uptime rather than wall time, |
39 |
so this is not an issue for fcron. And for other crons, there exists |
40 |
anacron, which is recommended precisely for this purpose by Gentoo. |
41 |
The only thing that's accomplished by putting this functionality in |
42 |
run-crons is to duplicate it, awkwardly. |
43 |
|
44 |
> > Furthermore, the files /var/spool/cron/lastrun/cron.* are |
45 |
> > ALREADY handled in the run-crons script itself, so that most of the |
46 |
> > above commands would seem to be redundant. |
47 |
> |
48 |
> this is most likely true. |
49 |
> |
50 |
> > This one also has the |
51 |
> > additional unpleasant property of filling the logs with useless |
52 |
> > messages: |
53 |
> > [fcron] Job /usr/bin/test -x /usr/sbin/run-crons && |
54 |
> > /usr/sbin/run-crons started for user |
55 |
> > systab |
56 |
> |
57 |
> yes, this sucks, but so it goes. |
58 |
|
59 |
So if it sucks, you would approve of an alternative that doesn't |
60 |
exhibit this behavior? |
61 |
|
62 |
-- |
63 |
Ryan Reich |
64 |
-- |
65 |
gentoo-dev@g.o mailing list |