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

Re: any consideration to creating a default template rc.conf.local?

Quoting Johan Torin (jtorin@myrealbox.com):
> On Friday 04 June 2004 19:05, Henning Brauer wrote:
> [...]
> > I find the current situation where rc.conf.local and rc.local are
> > treated so differently a bit unsatisfactory.
> Tell me about it... It has bugged me for years.

I know why because the rc.conf.local thing was mine.  2.3?  2.5?
I forget.

I had used it for a while myself, as a self done hack and eventually
Theo saw fit to put it in.

For me, MOSTLY it was a way to do an install without killing my
rc.conf info.  And you don't want it overwritten.

rc.local hasn't been local, really, for over a decade.  SunOS 3's
came full of stuff in the 80s.

rc.local has much deeper root in Unix tradition and habit.
It's full of the "extra" things.  Vendors have provided
populated rc.local's for a long long time.

My habit because to have it run rc.local.`domainname` and
rc.local.`hostname`  (with appropriate sanity checks) at
the end of rc.local.

This let me distribute per machine and per NIS domain rc files
to 400 machines without fancy sed stuff.

> That leaves startup shell code for cfsd, snmpd and netatalk,
> but perhaps that can be moved to /etc/rc too? Or simply
> be removed? There are lots of stuff in the portstree that
> doesn't have a entry in /etc/rc.local, samba for example.

snmpd is an add on.  ibid netatalk and the other things.
It should not be handled out of /etc/rc.

My solution has been startup/shutdown scripts.
/etc/rc.d/S10netsnmp.sh ->   /etc/init.d/netsnmp.sh

These come up and get rejected.  reasonably for "we don't really
want this at this point" reasons by developer types.  Stupidly for
"you're trying to make it system V and init levels are stupid" by
folks who need another hobby.  Or a course in logic.  I've never
advocated init levels (well SINGLE user and MULTI could be considered
that, but...)

A slightly ugly way to get an ordered startup.  rc.`hostname` just
spun through /etc/rc.d/S*.sh and ran them.

I did it when I had less Sr. people who were tasked with things
like "restart netatalk" or httpd or squid or whatever.  I trusted
them but limited mistake options with "sh /etc/init.d/netatalk restart"

Separate files also make it easy for a port to add its stop/start

I keep several of them alive on my own systems.  Default arguments
include start/stop/status/restart.

Since then, FreeBSD5 and NetBSD have a more clever way of ordering
startup scripts.  And they respect rc.conf (& .local) for _ENABLE

As it matures, perhaps it will be revisited.

> # cat rc.conf | grep "pf" >> rc.conf
Waste of a cat(1).   :)
grep "pf" >> rc.conf < rc.conf