#84 cross edition collaboration on default/fallback hostname
Closed by dustymabe. Opened by dustymabe.

In the Fedora Server working group meeting today I met with the team to discuss collaborating on a possible change to the default/fallback hostname in Fedora Cloud in the future.

The pitch for the change/collaboration is as follows:

Back in Fedora 33 the default hostname was changed from localhost to fedora on instances that didn't get the hostname set in any other way (i.e. it's the fallback if it's not set anywhere else). As far as I know this change came in in systemd and was never proposed as a change in Fedora itself.

Here's the original enablement upstream https://github.com/systemd/systemd/pull/5175 and the BZ requesting the change in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1392925

Unfortunately, this initiallly caused us in FCOS some pain because setting the hostname via reverse DNS lookups (via NetworkManager) stopped working along with breaking 3rd party tools that set the hostname. The NM problem was subsequently fixed, but it still remains that a lot of third party software will check to see if an instance's hostname is "unset" by checking the current hostname against the string "localhost". Additionally it even seems that this change will never be picked up by CentOS/RHEL (see https://src.fedoraproject.org/rpms/systemd/c/13d1341b108a24d13f5922054307b5c2efc6836a?branch=rawhide).

The open question is, what do we think the fallback hostname should be for server like instances? And.. Should we do anything to change it for a subset of Editions/Working Groups in Fedora?


The meeting attendees today seemed to believe we should make a change. Here is a transcript of the chat:

13:32:53              pboy | Dusty, go on.
13:33:21         dustymabe | Hi all. I've been making my rounds in the different working groups
                           | with a proposal about the default/fallback hostname. Here's my pitch:
13:33:37         dustymabe | Back in Fedora 33 the default hostname was changed from `localhost` to
                           | `fedora` on instances that didn't get the hostname set in any other
                           | way (i.e. it's the fallback if it's not set anywhere else). As far as 
                           | I know this change came in in systemd and was never proposed as a
                           | change in Fedora itself.
13:33:37         dustymabe | Here's the original enablement upstream
                           | https://github.com/systemd/systemd/pull/5175 and the BZ requesting the
                           | change in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1392925
13:33:37         dustymabe | Unfortunately, this initiallly caused us in FCOS some pain because  
                           | setting the hostname via reverse DNS lookups (via NetworkManager)
                           | stopped working along with breaking 3rd party tools that set the
                           | hostname. The NM problem was subsequently fixed, but it still remains
                           | that a lot of third party software will check to see if an instance's
                           | hostname is "unset" by checking the current hostname
13:33:37         dustymabe | against the string "localhost". Additionally it even seems that this
                           | change will never be picked up by CentOS/RHEL (see https://src.fedorap
                           | roject.org/rpms/systemd/c/13d1341b108a24d13f5922054307b5c2efc6836a?bra
                           | nch=rawhide).
13:33:37         dustymabe | The open question is, what do we think the fallback hostname should be
                           | for server like instances? And.. Should we do anything to change it
                           | for a subset of Editions/Working Groups in Fedora?
13:35:03              pboy | I would like to change it. The hostnaming for our server had broken,
                           | but I never got the reasen, until now that is
13:35:25         dustymabe | 🙂
13:35:35              pboy | And localhost is best practise for years, I think.
13:35:54              pboy | or for us at the moment "was"
13:36:11         dustymabe | +1 
13:36:27           salimma | on Workstation it's also almost never unset, really, right? I think by
                           | default it will be the admin user + something (haven't installed in a
                           | while)
13:36:34         dustymabe | What I've been doing for the other working groups is pitch it at the
                           | meeting and then create a ticket (for the record).
13:37:03         dustymabe | Does that seem reasonable here?
13:37:09           salimma | so I wonder who actually needs this non-localhost default. might be
                           | useful for containers published to Docker and other registries I  
                           | guess, but then it could be injected when making the container
13:37:10               <-- | boubou (~boubou@hide.my.ip.upsidehosting.com) has quit (Remote host   
                           | closed the connection)
13:37:32     Eighth_Doctor | so my strawman proposal is to switch systemd back to localhost for all
                           | variants
13:37:32           salimma | +1 for a ticket, I'm likely in favor too unless someone has a good
                           | rationale for keeping it 'fedora'
13:37:40         dustymabe | salimma: i think there's some autodiscovery protocols (maybe avahi)   
                           | where it's not good 
13:37:47     Eighth_Doctor | and then make Anaconda set the "fedora" hostname for installed systems
                           | by default if wanted
13:38:04           salimma | I like Neal's suggestino
13:38:12           salimma |  * I like Neal's suggestion
13:38:20           salimma | dustymabe: not good with 'localhost', or not good with 'fedora'?
13:38:27     Eighth_Doctor | the former
13:38:33         dustymabe | salimma: not good with `localhost`
13:38:38     Eighth_Doctor | mdns ignores localhost
13:39:00         dustymabe | see ^^ Eighth_Doctor knows more than I do
13:39:02           salimma | so yeah Workstation is probably the only one that needs to set it, it
                           | should not be the default for everyone
13:39:18     Eighth_Doctor | well, servers that are installed via anaconda should have it set too
13:39:27     Eighth_Doctor | because service discovery is totally broken without changing the
                           | hostname
13:39:31           salimma | ah, right. and servers installed individually
13:39:45              pboy | It you have 10 machines all 'fedora' it doesn't help mdns wise
13:39:50           salimma | but Anaconda already prompts for the hostname, right?
13:39:54     Eighth_Doctor | no
13:40:08     Eighth_Doctor | only if you go into the networking spoke
13:40:13           salimma | oh sigh
13:40:16              pboy | Anaconda offers to set in, but doesn't enforce it
13:40:43     Eighth_Doctor | what's even more annoying is that gnome-initial-setup doesn't offer a
                           | way to set the hostname right from the get go
13:40:56         dustymabe | so my original proposal was to change the default back to localhost on
                           | variants that want it to be that (alternatively, set the default to
                           | `fedora` just for variants that are workstation like)
13:41:17     Eighth_Doctor | server installs could be configured to require its configuration with
                           | initial-setup
13:41:34     Eighth_Doctor | but generally, I think a more reasonable default is localhost because 
                           | the fedora default causes problems for downstreams
13:41:55     Eighth_Doctor | systemd's default isn't read from os-release, it's hardwired into the 
                           | package build itself, which is very bad
13:42:03              pboy | Eighth_Doctor: +1
13:42:15         dustymabe | Eighth_Doctor: ehh - there are knobs in two places now
13:42:29     Eighth_Doctor | dustymabe: it's a bad knob because it only works on rhel right now    
13:42:43         dustymabe | there is the systemd compile time default and also a knob in
                           | os-release
13:42:51     Eighth_Doctor | people who do fedora derivatives without rebuilding everything are
                           | actually sorta out of compliance because of it
13:42:54         dustymabe | what only works on rhel?   
13:42:58     Eighth_Doctor | which is something we never intended to be a thing
13:43:20     Eighth_Doctor | dustymabe: systemd package has a rhel bcond to default to localhost
13:43:42         dustymabe | right I linked to that earlier - basically RHEL didn't pick up this
                           | change
13:43:58              pboy | Always these special requests   :-)
13:43:59     Eighth_Doctor | because someone realized that it's a branding problem
13:44:20     Eighth_Doctor | not because it was causing problems technically, but legally and
                           | politically
13:44:33         dustymabe | either way in fedora we have two knobs in systemd itself
13:44:39         dustymabe | there is the systemd compile time default and also a knob in
                           | os-release
13:44:50     Eighth_Doctor | yes, but systemd doesn't read the latter one
13:45:04         dustymabe | I think it does
13:45:08     Eighth_Doctor | because we have a default one set at compile time
13:45:42         dustymabe | https://github.com/coreos/fedora-coreos-config/pull/868
13:46:19         dustymabe | setting DEFAULT_HOSTNAME=foobar in /etc/os-release works
13:46:31     Eighth_Doctor | that's not the knob I was referring to
13:46:44         dustymabe | :) - well it was the one I was referring to
13:46:55     Eighth_Doctor | in parts of systemd, the fallback hostname can be automatically
                           | derived from ID in os-release
13:47:06              pboy | Short note: 15 Mins left.
13:47:09     Eighth_Doctor | I believe both nspawn and hostnamed do this
13:47:18         dustymabe | what i'm saying here is that knob is another option for us when we   
                           | think of how to overcome this change and get what we want
13:47:24     Eighth_Doctor | anyway, I just want our compile time option to be dropped so we go    
                           | back to localhost
13:47:31         dustymabe | Eighth_Doctor: that works for me too
13:47:41     Eighth_Doctor | everything else is special sauce bikeshedding
13:47:47              pboy | My impression so far: we are good with "Server WG supports a check to
                           | return to the possibility of defining the hostname via DHCP and local
                           | host as transinient hostname (fall back). " 
13:47:58         dustymabe | but if we want workstation to keep `fedora` then we can just have them
                           | set `DEFAULT_HOSTNAME=fedora`
13:48:04     Eighth_Doctor | and frankly, gnome-initial-setup should ask people what to name the
                           | computer
13:48:18         dustymabe | pboy: +1
13:48:35         dustymabe | yes let's just agree we want it back the way it was and work out
                           | details later
13:48:40     Eighth_Doctor | sure if that's what we want to do
13:48:46     cooltshirtguy | pboy: +1
13:48:49         dustymabe | I'll open a ticket with this info

The current proposal is that we should work to get back to the default/fallback being localhost for Server. This matches what FCOS is currently doing (see https://github.com/coreos/fedora-coreos-tracker/issues/902). How we achieve that goal together is an implementation detail.


At least @salimma and @ngompa - were interested in working with me on a change proposal related to this.

And the largely unanimous position of Server WG today was that we would be happy if we could find a way to restore the behavior of Pre F33 for Server as well. And that without giving up the advantages of the current approach for other editions.

From my point of view would be especially important:
(a) localhost as fallback rsp. transient name, if nothing else is specified during installation.

(b) Take over the hostname from DHCP, if the hostname is not set statically via hostnamectl / Anaconda configuration.

Both properties are important if you have to manage a bunch of servers.

Issue tagged with: in progress

The change proposal was accepted for Fedora 37 (see the FESCO issue).

I'll close out this issue and we can all follow the tracking BZ for updates.

The change proposal was accepted for Fedora 37 (see the FESCO issue).

I'll close out this issue and we can all follow the tracking BZ for updates.

Metadata Update from @dustymabe:
- Issue status updated to: Closed (was: Open)

Metadata Update from @dustymabe:
- Issue status updated to: Closed (was: Open)

Metadata Update from @pboy:
- Issue untagged with: in progress

Metadata