From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: networkmanager hostname woes Date: Thu, 14 Sep 2017 10:17:08 +0200 Message-ID: <878thhd797.fsf@gnu.org> References: <20170913.120529.1808480687765633530.thomas.danckaert@aeronomie.be> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsPKl-0004Cn-Hw for help-guix@gnu.org; Thu, 14 Sep 2017 04:17:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsPKg-0008PC-J5 for help-guix@gnu.org; Thu, 14 Sep 2017 04:17:15 -0400 In-Reply-To: <20170913.120529.1808480687765633530.thomas.danckaert@aeronomie.be> (Thomas Danckaert's message of "Wed, 13 Sep 2017 12:05:29 +0200 (CEST)") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: Thomas Danckaert Cc: help-guix@gnu.org Hi Thomas, Thomas Danckaert skribis: > AFAIU, the cause is that networkmanager changes my hostname I=E2=80=99ve never experienced this (even though I don=E2=80=99t have /etc/= hostname), but that looks like a serious bug we should fix. Why would NM fiddle with the host name? I see that NM implements a =E2=80=9CSetHostname=E2=80=9D D-Bus RPC, and =E2= =80=98nmtui=E2=80=99 has a menu item to change the host name. In NM, the =E2=80=98update_system_hostname=E2=80=99 function has this comme= nt: /* Hostname precedence order: * * 1) a configured hostname (from settings) * 2) automatic hostname from the default device's config (DHCP, VPN, etc) * 3) the last hostname set outside NM * 4) reverse-DNS of the best device's IPv4 address * */ Then nm-settings.c has code to deal with host names in all sort of unpredictable ways. To give you an idea: --8<---------------cut here---------------start------------->8--- #define HOSTNAME_FILE_DEFAULT "/etc/hostname" #define HOSTNAME_FILE_UCASE_HOSTNAME "/etc/HOSTNAME" #define HOSTNAME_FILE_GENTOO "/etc/conf.d/hostname" [...] #if defined(HOSTNAME_PERSIST_SUSE) #define HOSTNAME_FILE HOSTNAME_FILE_UCASE_HOSTNAME #elif defined(HOSTNAME_PERSIST_SLACKWARE) #define HOSTNAME_FILE HOSTNAME_FILE_UCASE_HOSTNAME #elif defined(HOSTNAME_PERSIST_GENTOO) #define HOSTNAME_FILE HOSTNAME_FILE_GENTOO #else #define HOSTNAME_FILE HOSTNAME_FILE_DEFAULT #endif [...] static gchar * read_hostname_gentoo (const char *path) --8<---------------cut here---------------end--------------->8--- So, like Chris wrote, it honors /etc/hostname or /etc/HoSTNaM3 depending on the phase of the moon. I don=E2=80=99t understand the logic in there, but a quick fix would be to = have =E2=80=98network-manager-service-type=E2=80=99 create /etc/hostname. What do people think? Ludo=E2=80=99.