FS#26479 - [initscripts] Allow file inclusion in /etc/rc.conf
Attached to Project:
Arch Linux
Opened by Nico Schottelius (telmich) - Sunday, 16 October 2011, 17:57 GMT
Last edited by Tom Gundersen (tomegun) - Wednesday, 09 November 2011, 00:54 GMT
Opened by Nico Schottelius (telmich) - Sunday, 16 October 2011, 17:57 GMT
Last edited by Tom Gundersen (tomegun) - Wednesday, 09 November 2011, 00:54 GMT
|
Details
On Archlinux /etc/rc.conf is the main configuration file and
thus it is needed to be able to maintain it from automatic
configuration tools like cdist
(http://www.nico.schottelius.org/software/cdist/).
In automatic configuration management, you usually have multiple locations to construct the system configuration. Modern configuration management systems describe **state** and do not **run scripts**. Describing the state of /etc/rc.conf in different locations is a pain, putting it together error prone and may omit stuff that should have been included. Thus to open the doors for automatic configuration management on Archlinux I propose to introduce /etc/rc.conf.d, which includes bash scripts in the same manner as rc.conf, which are read sequentially (i.e. 0 to 9, A-z, the standard shell globbing). I think this is no big change in how Archlinux works, but gives great freedom to people trying to use Archlinux in big (hear enterprise, if you want) environments. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Wednesday, 09 November 2011, 00:54 GMT
Reason for closing: None
Additional comments about closing: Please continue any further discussion on the ML.
Wednesday, 09 November 2011, 00:54 GMT
Reason for closing: None
Additional comments about closing: Please continue any further discussion on the ML.
I understand your problem though, and I'd be interested in working with you to solve it. My suggestion for solving it would be:
Many of the variables in rc.conf can be defined in their "native" or distro-independent (read "systemd") location, so all you'd have to do is to make sure they are unset in rc.conf and configure them elsewhere. In that case you'll have (roughly) one file per variable, and they will not be bash scripts, so automating configuration should be easy. This is the current situation:
LOCALE: set LANG in /etc/locale.conf instead (http://0pointer.de/public/systemd-man/locale.conf.html)
DAEMON_LOCALE: cannot be set elsewhere
HARDWARECLOCK: set the third line in /var/lib/hwclock/adjtime, assuming /var is on the root partition (man hwclock).
TIMEZONE: symlink /etc/localtime to your zoneinfo file yourself (man timezone)
KEYMAP/CONSOLEFONT/CONSOLEMAP: cannot be set elsewhere (but I'd accept a patch for http://0pointer.de/public/systemd-man/vconsole.conf.html)
USECOLOR: cannot be set elsewhere
MODULES: cannot be set elsewhere (but I'd accept a patch for http://0pointer.de/public/systemd-man/modules-load.d.html if it follows the style of what we do with sysctl and tmpfiles)
UDEV_TIMEOUT: cannot be set elsewhere, but udev would accept a patch for doing this in /etc/udev/udev.conf
USE{DMRAID,BTRFS,LVM}: cannot be set elsewhere (should go away one day once upstream gets their acts together)
HOSTNAME: cannot be set elsewhere (but I'd accept a patch for http://0pointer.de/public/systemd-man/hostname.html)
interfaces/...= cannot be set elsewhere, use a proper networking solution
NETWORK_PERSISTS: cannot be set elsewhere, but should go away, i need to look into it, patches/explanations welcome
DAEMONS: cannot be set elsewhere
What do you think?
I'll add module-load.d support if there is demand for it, but that'll take a bit longer. If someone provide patches I'll probably include them in the next release (~one month from now), otherwise I'll get to it when I have time.
This means your tool would destroy any custom bash magic the user has put in rc.conf, but if you move out most other stuff, this might not be so bad? Maybe it would be worth declaring that bash-magic is frowned upon in rc.conf?
I think the best way forward is to write a suggestion to arch-projects@archlinux.org, and gauge everyone's mood on the topic.
cconfig only knows about flat files without the need for parsing.
Thus, we could restructure (and make everything WAY MORE SIMPLE (</capslock>)) it as follows:
/etc/rc.conf.d/daemons: \n seperated list of stuff to start, supporting @ and ! as it is right now
/etc/rc.conf.d/*: same for the rest, no \n seperation if it is only a single value.
I think I'll drop a longer mail to arch-projects this evening describing the idea more in detail.
I agree in principle that having config files not be bash would be nice, but I also agree with those who are reluctant to change things. At the end of the day, I guess I'll be the easiest to convince, but the other's might need a more convincing argument / use-cases.