FS#27732 - [initscripts] extend way to set hostname
Attached to Project:
Arch Linux
Opened by Jakub Bittner (rexcze) - Tuesday, 27 December 2011, 09:02 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 27 December 2011, 15:04 GMT
Opened by Jakub Bittner (rexcze) - Tuesday, 27 December 2011, 09:02 GMT
Last edited by Tom Gundersen (tomegun) - Tuesday, 27 December 2011, 15:04 GMT
|
Details
Hostname is set in /etc/rc.conf, but if /etc/rc.conf is
managed on hundred nodes by puppet it is very difficult to
set hostname. I suggest this:
If hostname in /etc/rc.conf is left blank system should take a look at /etc/hostname and set it according this file. |
This task depends upon
Closed by Tom Gundersen (tomegun)
Tuesday, 27 December 2011, 15:04 GMT
Reason for closing: Implemented
Tuesday, 27 December 2011, 15:04 GMT
Reason for closing: Implemented
My personal opinion is that retaining a unique file for the most basic configuration items should be preferred to splitting this file into many subfiles, however optional they may be at first. And it would be quite sad if decisions on such matters were driven by technical limitations of tools such as puppet, which one can perfectly well overcome with a simple combination of standard Unix tools.
I can create script which change hostname after puppet runs, but are you sure it is the right way? I think its not.
This (http://0pointer.de/public/systemd-man/hostname.html) is what is done on at least Debian, Ubuntu, Fedora and Suse so supporting this also on Arch seems like a good idea to me. We would not install this file by default, but use it if the admin creates it (like we do with vconsloe.conf and locale.conf).
As to using sed for editing rc.conf, this will work in all sensible cases. However, there is nothing stopping users from being stupid and creating a function in rc.conf that computes the hostname in arbitrary ways.
The authors of Puppy (or similar software) can of course say that they only support "reasonable" rc.conf, but I would understand if the authors would not find this very satisfying.
Lastly, HOSTNAME is already special. This is the only variable defined in rc.conf that really should be set, the rest are optional. If we added support for /etc/hostname, we could boot with an empty rc.conf, or more likely, one that just contains DAEMONS (which is the only truly Arch specific thing we have, the rest of rc.conf is just us doing the same as everyone else in our own way).
I just don't think we should split HOSTNAME to its own file *only* because certain tools prefer that (because then, we might as well make DAEMONS a directory containing one file per rc.d script to be launched, etc.).
I'd be against changing the way we deal with DAEMONS in any meaningful way (as we are the only ones doing anything like that).
I'll push out a new patch to add /etc/hostname support and see if anyone tries to kill me :-)