Hostname Management



Hello

I'm trying to control a device hostname independently of NetworkManager, but am unable to disable NetworkManager's hostname management. I'm using NM version 1.28.2

I've added the following to the configuration file:

[main]
hostname-mode=none

When NM starts at boot I see the following messages:

hostname: hostname: using hostnamed
hostname: hostname changed from (none) to "<my hostname>"

Using nmcli to set the hostname triggers a DBus call to set the static (which fails) and transient (which succeeds) hostnames:

Jul 23 16:11:03 OldHostname dbus-daemon[1368]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.4' (uid=0 pid=1472 comm="/usr/sbin/NetworkManager --no-daemon ")
Jul 23 16:11:03 OldHostname audit: AUDIT1334 prog-id=35 op=LOAD
Jul 23 16:11:03 OldHostname audit: AUDIT1334 prog-id=36 op=LOAD
Jul 23 16:11:03 OldHostname kernel: audit: type=1334 audit(1627056663.748:120): prog-id=35 op=LOAD Jul 23 16:11:03 OldHostname kernel: audit: type=1334 audit(1627056663.748:121): prog-id=36 op=LOAD Jul 23 16:11:03 OldHostname dbus-daemon[1368]: [system] Successfully activated service 'org.freedesktop.hostname1' Jul 23 16:11:03 NewHostname systemd-hostnamed[10804]: Failed to write static host name: Device or resource busy Jul 23 16:11:03 NewHostname NetworkManager[1472]: <warn> [1627056663.9942] hostname: could not set hostname: GDBus.Error:System.Error.EBUSY: Failed to set static hostname: Device or resource busy Jul 23 16:11:03 NewHostname NetworkManager[1472]: <info> [1627056663.9944] audit: op="hostname-save" arg="NewHostname" pid=10800 uid=0 result="fail" reason="Saving the hostname failed."

I was hoping that nmcli would return "set-hostname: hostname is unmanaged" when hostname-mode set to 'none'.

I have two questions:
1) Can I configure NM so that it doesn't make any attempts to change either the static or transient device hostname? 2) If I change the hostname externally from NM should the NM service be restarted?

Thanks

Mark
--


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]