[systemd-devel] systemd and hostnamed (and nss-myhostname) - an alternative path
jerome at silentdome.com
Fri Jul 29 05:50:03 PDT 2011
I'm a happy Arch Linux user of systemd. I want to share a few of my
thoughts about systemd's interaction with the system hostname.
Here's my understanding of how systemd currently sets the hostname
* hostnamed is included in the systemd package
* During early boot systemd makes a call to hostnamed and the
set to the value in /etc/hostname
My proposal for systemd's interaction with the hostname
* hostnamed & nss-myhostname are packaged together in a 'hostnamed'
* systemd requires this new package
* A 'Set Hostname' unit is distributed with systemd. Users and
free to override the unit if needed
* (Wishlist/Off topic) Has any thought been given to having the
and syslogs listen via dbus for a hostname changed signal so they can
immediately change the hostname displayed and their log messages.
any other apps/daemons that could benefit from doing this?
* I have a use case where I need to change the hostname on each
boot at boot
time. I'm able to do this with a custom 'Set Hostname' unit but my
always show the hostname from the previous boot because systemd
sets it to
the value in /etc/hostname before I can change it. I also loose
boot because hostname is being set twice. If I could just set an
ExecStartPre on a systemd provided 'Set Hostname' unit my isues
* There is absolutely nothing systemd specific about hostnamed
(Correct me if
I'm mistaken). Non-systemd distros/users can benefit from
hassle if it's maintained outside of the systemd tree
Downside to my method
* Hostname is set a few milliseconds later in the boot process
* Flexibility to support my and yet to be forseen use cases for a
hostname change at boot without effectively setting the hostname twice
and having an incorrect hostname in syslog messages
* Non-systemd distros get to easily share in the greatness of hostnamed
I've been thinking about this issue for awhile but this email was
sparked when I
noticed an item on the TODO for systemd that mentions an intent to
pull nss-myhostname into systemd.
Sorry for such a long first mail but please share your thoughts.
More information about the systemd-devel