Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-4710

Modifying the hostname is not being applied immediately

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • None
    • rhel-8.3.0, rhel-9.3.0
    • initial-setup
    • None
    • Moderate
    • rhel-sst-installer
    • ssg_front_door
    • None
    • False
    • Hide

      None

      Show
      None
    • No
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:

      When modifying the hostname through using the initial-setup GUI or Text interface, upon exiting the tool, the hostname is not used on the system, as shown in the example below, consisting in renaming "vm-gui83" into "vm-gui83-renamed":

      1. Before renaming

      1. hostnamectl | grep "vm-gui83"; cat /etc/hostname /proc/sys/kernel/hostname
        Static hostname: vm-gui83
        vm-gui83
        vm-gui83

      2. After renaming and clicking on "Apply" (GUI only)

      1. hostnamectl | grep "vm-gui83"; cat /etc/hostname /proc/sys/kernel/hostname
        Static hostname: vm-gui83
        Transient hostname: vm-gui83-renamed
        vm-gui83
        vm-gui83

      3. After exiting the configuration tool

      1. hostnamectl | grep "vm-gui83"; cat /etc/hostname /proc/sys/kernel/hostname
        Static hostname: vm-gui83
        Transient hostname: vm-gui83-renamed
        vm-gui83
        vm-gui83

      --> hostname not applied

      In fact, in order for the hostname to apply really (reflecting in /proc/sys/kernel/hostname), it is necessary to wait for systemd-hostnamed service to exit, then issue a "hostnamectl" command. The systemd-hostnamed service will then discover that /etc/hostname (set by initial-setup) is different than current hostname (old not renamed "vm-gui83") and apply the modification.

      The bug here is that initial-setup should modify the Static hostname upon finishing the configuration, not the Transient hostname.

      4. After systemd-hostnamed exited and a "hostnamectl" was issue again

      1. hostnamectl | grep "vm-gui83"; cat /etc/hostname /proc/sys/kernel/hostname
        Static hostname: vm-gui83-renamed
        vm-gui83-renamed
        vm-gui83-renamed

      --> hostname finally applied

      Version-Release number of selected component (if applicable):

      initial-setup-0.3.81.6-1.el8.x86_64

      How reproducible:

      Always, see procedure above.
      To start the initial-setup on boot, just enable "initial-setup-reconfiguration.service", "touch /.unconfigured" and reboot

              mkolman@redhat.com Martin Kolman
              rhn-support-rmetrich Renaud Métrich
              Martin Kolman Martin Kolman
              Release Test Team Release Test Team
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: