Subject: rc.d config file proposal
To: None <tech-userlevel@netbsd.org>
From: Frank van der Linden <frank@wins.uva.nl>
List: tech-userlevel
Date: 03/15/2000 20:06:37
I thought about the rc config files for a while (not the whole structure,
but just the config files), and came to a proposal that I think is
reasonable. On the other hand, it's a compromise, so probably noone will
like it :-)

It is important that automated install procedures can easily drop in
startup script and their configuration. When using monolithic configuration
files (e.g. rc*.conf), this is somewhat harder. If you want to do
this in an automated fashion, you have to parse the files, check
if the options already exist, etc. Which isn't completely trivial,
especially since the current .conf files are really shellscripts in
disguise.

So, I do think that for pkgs and local scripts, it would be good
to have seperate config files, that can just be dropped in.
On the other hand, there are people who like to have configuration
in one file, and they like the current rc.conf. That's why I came
to the following:

0) The /etc/rc.d scripts, and helper library /etc/rc.subr, remain as
   is. Please be reminded that all these scripts are called
   from /etc/rc, so if you want one /etc/rc, you can still
   do that (but it's no longer the "officially sanctioned" way).

1) Keep /etc/rc.conf, for configuration of the base system. 3rd party
   packages do not need to modify this file. The only time that it
   needs to be automatically modified is when doing an upgrade. This
   comes down to documenting the new options, and having the install
   procedure add them, with their default values. In the case that
   configuration options change to another name, well, splitting up
   config files isn't going to help you then either.

2) Have /etc/rc.pkg.d, /etc/rc.local.d, and their counterparts,
   /etc/rc.pkg.conf.d and /etc/rc.local.conf.d (or other names,
   but they're seperate directories somewhere in /etc). In
   rc.subr, do something like:

	. /etc/rc.$confbase.conf
	if [ -f /etc/rc.$confbase.conf.d/$name.conf ]; then
		. /etc/rc.$confbase.conf.d/$name.conf
	fi

   In other words, use the global file, but if a "private" config file
   for package "$name" (with a startup script by that same name) exists,
   use it, and let it override the global one.

This scheme should satisfy people who like their base system configuration
in one place, and it provides for easy drop-in configuration of 3rd party
packages. And for the monolithically-minded, even those can be put into
the rc.local.conf and rc.pkg.conf file, if they want. Also, it's a very
minimal change to the rc.d code already in the tree.

- Frank