| Summary: | drakx-net should write (& read) /etc/hostname too for systemd | ||
|---|---|---|---|
| Product: | Mageia | Reporter: | Lucien XU <sfietkonstantin> |
| Component: | RPM Packages | Assignee: | Colin Guthrie <mageia> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Normal | CC: | bittwister2, davidwhodgins, dmorganec, juergen.harms, lmenut, mageia, mageia, thierry.vignaud |
| Version: | Cauldron | Keywords: | PATCH |
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Source RPM: | libdrakx-net | CVE: | |
| Status comment: | |||
| Bug Depends on: | |||
| Bug Blocks: | 2120 | ||
| Attachments: | update hostname in /etc/hostname | ||
|
Description
Lucien XU
2011-10-08 16:03:49 CEST
Manuel Hiebel
2011-10-08 21:12:01 CEST
Source RPM:
(none) =>
net-tools Works ok here. $ grep -i hostname /etc/sysconfig/network HOSTNAME=hodgins.homeip.net $ echo $HOSTNAME hodgins.homeip.net It's set in /etc/rc.d/rc.sysinit, which means you have to reboot after changing the hostname. Line 8 sets it to the value returned by the hostname command. Line 15 source /etc/sysconfig/network, so if it is defined in that file, that will overwrite the line 8 setting. Line 23 will set it to localhost if it is not already set. Line 304 uses the hostname command to set the kernels version of the hostname to match the value from the above settings. CC:
(none) =>
davidwhodgins Ah. Good point. I didn't notice that the bug report was for cauldron. Are every chauldron distro with systemd ? How be sure that I'm running systemd (because I feel like still running initscripts) Hardware:
i586 =>
x86_64 now cauldron should use systemd by default. Try to add your hostname in /etc/hostname, reboot and see if it is applied. Nothing happen Note that the hostname is set first, but is then set to $HOSTNAME. (I can see during the booting process that it is set (KDM display "localhost") but then, it sets $HOSTNAME) what happens with a "new user" ? A fresh install ? Because it is system-wide. Even not login, this happen : The KDM starts quickly, and display "localhost" as machine name. But restarting X (KDM) after TTY is available (booting finished), it wil display $HOSTNAME.
D Morgan
2011-10-27 21:41:08 CEST
Blocks:
(none) =>
2120 Similar problem here: At install, I specify as host pcjuergen.unige.ch. After booting the system, the shell prompt says "localhost", and typing the command "hostname" also provides localhost. Nevertheless, my /etc/sysconfig/network contains the correct line "HOSTNAME=pcjuergen.unige.ch" This is independant from kdm: same problem if I type "hostname" in a console, immediately after booting (running a 32-bit system on a Dell Optiplex 755 system). If, after booting, I explicitely define the hostname by typing "hostname pcjuergen.unige.ch" the hostname remains correctly set, and the shell prompts show pcjuergen.unige.ch as they should. But after rebooting, I am back at localhost. So, it looks as if the mechanism for defining the hostname work correctly, but during boot the hostname is not correctly replicated from the value defined in /etc/sysconfig/network CC:
(none) =>
juergen.harms I'm with a fresh install of 2 alpha 1. Using systemd on a single / /usr partition (no separated /usr). And using a self defined hostname in /etc/sysconfig/network. The problem do not exist anymore. The problem persists for me: fresh install yesterday (26.11) at about 18h00 (all directories in a single root partition). All updates available up to 7h30 this morning installed. Still faulty behaviour precisely as described in comment 9 - in spite of now having done a fresh install. I confirm the comment 9. systemd and recent initscripts (rc.sysinit) use /etc/hostname, but the installer or drakconnect write the hostname only in /etc/sysconfig/network, and don't write/update /etc/hostname. In network.pm, write_hostname should keep in sync hostname in /etc/sysconfig/network and /etc/hostname. Please, could you review the proposed patch in attachment. regards, Luc CC:
(none) =>
lmenut, mageia Created attachment 1143 [details]
update hostname in /etc/hostname
Luc, thanks for the patch. blino, I'm assigning this one to you as libdrakx-net maintainer. Assignee:
bugsquad =>
mageia
Manuel Hiebel
2011-11-28 08:17:49 CET
Keywords:
(none) =>
PATCH seems correct. Blino, can we have your review please ? (In reply to comment #12) > I confirm the comment 9. > systemd and recent initscripts (rc.sysinit) use /etc/hostname, but the > installer or drakconnect write the hostname only in /etc/sysconfig/network, and > don't write/update /etc/hostname. This is not completly true, systemd %post handle this. Maybe there is a bug somewhere. So on a fresh install hostname is set to localhost and in a update this is set to what we had in /etc/sysconfig/network, but where you are right this is if the hostname is graphically modified during install or in drakconnect. ( i just wanted to add more informations ). PS: ok bug found in the systemd packaging side should be OK on next systemd rpm. but the patch still stay valid.
Thierry Vignaud
2011-11-28 10:06:48 CET
CC:
(none) =>
thierry.vignaud I'll take this one from Blino (tho' his input is, as always, most welcome too). Status:
NEW =>
ASSIGNED OK, should be fixed in drakx-net-1.3 Please feel free to review the slightly expanded version of Luc's patch. http://svnweb.mageia.org/soft?view=revision&revision=2566 I also wrote "localhost" to the file if no real hostname was available (which is what the %post script in the systemd rpm does. Status:
ASSIGNED =>
RESOLVED |