Linux will allow to set hostname before userspace is started

Hostname on Linux

El hostname in systems based on Linux it is used a lot for different applications, but accessing it is usually done by the workspace and the init system when starting the operating system. The problem can occur if some user space process attempts to read the hostname from the system before it has been set. These problems are or may be part of the present, but their days are numbered and they will disappear during this 2022.

It has been Dan Molding (via Phoronix) who has introduced a kernel parameter in the form of a patch that will allow set the hostname before the workspace starts. Larabel explains one possible scenario where this could be a problem: mdadm relies on the hostname to determine whether it is a local or foreign disk array, and takes different paths. «If mdadm tries to get the hostname before it is read from the file system and set by the init system, you might encounter unexpected behavior", Explain.

Hostname before user-space on Linux in 2022

What this patch would allow would be to set the "hostname=" kernel parameter to something else during the OS boot process, before the file system is mounted and user space has been started. This is an extra step to go from users to administrators in some scenarios, which can be a hassle, but it will be an option that can be used or not. As almost always in Linux, the choice will be ours.

About when this change will be available, that everything must be said, it is likely that not many of us will use it, it is expected to arrive next to Linux 5.19. Linux 5.18 is in development right now, and its stable release is more than likely to arrive tomorrow, so 5.19 should land on July 24 or July 31.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.