How to set the hostname assigned by DHCP server? fallback-hostname breaks transient hostname

New install of latest stable XFCE ISO, 21.0.7.

The machine was running the previous version with no issues.

The external symptom is, I enter my password and lightdm just redisplays the greeter. I enter my password a second time and I get successfully logged on.

However, looking at the journal, I see lightdm-gtk with a segfault in libcairo and a corresponding coredump, /usr/bin/lightdm-gtk-greeter.

It is similar to:
https://bugs.archlinux.org/task/47694

And the arch wiki work-around is to create a /etc/hostname file. I have my own dhcp and it shouldn’t be required.

If I add the /etc/hostname file lightdm doesn’t segfault.

I have installed other versions of Manjaro with no problem, but this is the first install from this ISO.

Any solution to this problem, other than the work-around?

Snippet

Also similar to:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946166

I have changed my xfce installs to slick greeter. Works fine. It is much nicer and maybe solves yor problem.

Thanks @banjo. Changing to slick greeter did not help the hostname/logon_twice problem, but there was no segfault/coredump :slight_smile:

What I know so far:

  1. Among other things, this is a timing problem.
    If I change lightdm.conf to contain greeter-setup-script=<SCRIPT> and that SCRIPT only does sleep 1.5s, I get the correct hostname displayed on the greeter. I only need to enter my password once and I’m logged on successfully. I suspect new installs are much more likely to be impacted by this bug.

  2. On the greeter, gtk or slick, I initially see the hostname manjaro. When I enter my password the first time, the greeter is redisplayed with the correct hostname. The second password attempt is completed successfully.

My questions:

  1. Where does the hostname manjaro come from?

  2. Why is manjaro in/var/run/lightdm/root/:0 initially (which causes this problem) and not the dhcp hostname?

I changed the title as shown below because only lightdm-gtk-greeter segfaulted, but both greeters showed the wrong hostname initially.

  • From: Lightdm-gtk-greeter cairo segfault - first logon fails, second succeeds

  • To: New install - first logon fails, second succeeds due to hostname=manjaro

Steps:

  1. Install XFCE ISO - 21.0.7

  2. Remove /etc/hostname

  3. Reboot
    The greeter shows Manjaro in the hostname location. If I cat /var/run/lightdm/root/:0, I see manjaro.

  4. Type password.
    Login fails. The greeter is re-displayed, but now the greeter and the run file show the correct hostname.

  5. Type password.
    Login succeeds.

I interjected an artifical delay into lightdm (greeter-setup-script) and after a reboot the hostname is correct.

I have also noticed, that after some time, the problem goes away on its’ own (boot process becomes busier ??). After I install and get this problem, I reboot several times, I view the logs, and at some point, I consistently get the correct hostname and the first login succeeds. This is repeatable, if I reinstall, it starts all over again.

Anyone else run into this on a new install?

Why is manjaro being picked up as the hostname? For the life of me, I can’t figure out where that coming from.

$ pacman -Qo /etc/hostname 
/etc/hostname is owned by filesystem 2021.01.19-1

Why would you remove that file?
The filesystem package and therefor this file should be present on every manjaro installation.

Compile time configured fallback, see

So the transient hostname is used.

hostnamectl  --static set-hostname ""  # removes /etc/hostname from system

Great to know.

I’m looking at the journal and the manjaro hostname started appearing in January of this year. It has been impacting my current machines, but it was a new install that really highlighted the bug because it impacts the lightdm greeter.

It seems fallback-hostname has been around since 233. I can’t tell from Manjaro gitlab commits when or if it changed. It looks like it might be the 12/30/2020 Stable update.

This redhat bug report describes what is happening:

Bug 1892235 - fallback-hostname change in F33 broke unset hostname detection logic

I have really been meaning to read the systemd news on all updates. I found this in the systemd-248 news too:

I found the entry below, but the solution seems to be going from Arm 20.8 to 20.10 on a Raspberry PI, so doesn’t help me :frowning:

I’m going to change the title, because if I can get the transient hostname correct all problems will be solved :slight_smile:

Oh, thank you for reminding me of thread I opened and failed to close. As it turns out, for my setup, all that is required is to delete the /etc/hostname file. Then the client will accept option host-name "rpi-name" as assigned in the server 's dhcpd.conf.

To prevent the coredump, my work around is to put a wait on greeter-setup-script in lightdm.conf until hostnamectl --transient is valid.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.