Subject: Re: Implementing periodic.d
To: None <tech-userlevel@netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: tech-userlevel
Date: 04/04/2004 04:13:34
Hubert Feyrer <hubert@feyrer.de> wrote on Sat,  3 Apr 2004
at 12:20:58 +0200 in <Pine.GSO.4.53.0404031131270.29662@rfhpc8320>:

> FreeBSD 4.9 and 5.x do
...
>  * ordering of scripts by numbers in filename:
> 	ice% ls /etc/periodic/daily/
> 	100.clean-disks         300.calendar            440.status-mailq
> 	110.clean-tmps          310.accounting          450.status-security
> 	120.clean-preserve      320.rdist               460.status-mail-rejects
> 	130.clean-msgs          330.news                470.status-named
> 	...
>    We clearly can do better here.

Julio M. Merino Vidal <jmmv@menta.net> wrote on Sun,  4 Apr 2004
at 00:18:52 +0200 in <20040404001852.20de3702.jmmv@menta.net>:

> Also, from Hubert's comments, I see that what I've done is quite
> similar to what FreeBSD has (though I haven't checked), with the
> exception that this uses rcorder to sort the scripts, instead of
> numbers in names.  (Note that rcorder is mostly useless now, because
> none of the scripts provided contain any of the special keywords
> recognized, but scripts can be easily ordered if needed; just as
> rc.d).


I am not convinced that using rcorder-style sorting is superior to the
strictly numerical sorting.

The rcorder sort is good when the user doesn't need to see the big
picture of what runs in what order, but just knows a series of
dependancies: A comes before B, C after B, etc.

rcorder is not so great for knowing exactly what the order is going
to be. If you want to know, you have to do something like:

sh -c '. /etc/rc.conf; rcorder -s nostart ${rc_rcorder_flags} /etc/rc.d/*'

or if you're lazy and willing to take assumptions, 'rcorder /etc/rc.d/*'.

Either way it is a bit unwieldy and awkward -- it could be less so
with another tool, of course.

With something like periodic.d, I would expect that it's more important
for the user to see the big picture than it is to be able to have programs
automatically insert events such that they are relative to other events.
Maybe I'm wrong here, or there is a middle ground?

Any opinions?

--jhawk

p.s.: jmmv, your lines pass 80 columns when prefixed with '> ';
perhaps wrap them to 70 instead?