Bug 934056

Summary: netcfg: do not use .site as default TLD
Product: [openSUSE] openSUSE Tumbleweed Reporter: Ludwig Nussel <lnussel>
Component: YaST2Assignee: Tomáš Chvátal <tchvatal>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: tiwai
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 923990    

Description Ludwig Nussel 2015-06-09 08:44:30 UTC
+++ This bug was initially created as a clone of Bug #923990 +++

going forward /etc/hostname should IMO not contain anything by default. Just mark it %ghost.
Comment 1 Ludwig Nussel 2015-06-09 08:45:16 UTC
maybe we could even merge netcfg into aaa_base
Comment 2 Ludwig Nussel 2015-06-09 09:49:08 UTC
or rather net-tools where the manpages of most files are
Comment 3 Tomáš Chvátal 2015-06-09 10:46:48 UTC
The hostname stuff is fun.

Especially all the migrations around.
Also yast writes there, we would need to tweak it out to talk with systemd and tell it to set hostname by its mechanisms instead of writting it to the file.

I don't mind where the files are put in the end, there is like 1 bug per 5 years on this package, so it is almost no-effort to keep it working :)
Comment 4 Tomáš Chvátal 2015-06-11 15:40:28 UTC
Sent it to the Factory.

Anyway if you want to put it all into separate package file a bug against the other one. I am willing to give this pkg up ;-)
Comment 5 Bernhard Wiedemann 2015-06-11 16:00:09 UTC
This is an autogenerated message for OBS integration:
This bug (934056) was mentioned in
https://build.opensuse.org/request/show/311665 Factory / netcfg
Comment 6 Bernhard Wiedemann 2015-08-04 08:00:07 UTC
This is an autogenerated message for OBS integration:
This bug (934056) was mentioned in
https://build.opensuse.org/request/show/320307 Factory / netcfg
Comment 7 Takashi Iwai 2015-08-25 06:15:41 UTC
The recent update broke my machine after updating Tumbleweed.
Now it got an empty /etc/HOSTNAME and the old one was stored in /etc/HOSTNAME.rpmorig.  And hostname command returns "localhost".

Meanwhile /etc/hostname (and /etc/hostname.rpmorig) contain the right string.
Comment 8 Tomáš Chvátal 2015-08-25 07:30:25 UTC
(In reply to Takashi Iwai from comment #7)
> The recent update broke my machine after updating Tumbleweed.
> Now it got an empty /etc/HOSTNAME and the old one was stored in
> /etc/HOSTNAME.rpmorig.  And hostname command returns "localhost".
> 
> Meanwhile /etc/hostname (and /etc/hostname.rpmorig) contain the right string.

Can't reproduce on any of the testing Factory deploiments I have.

Any insight on how the layout was done before you updated?

Eg. HOSTNAME being proper symlink to hostname or something special, etc etc.
Comment 9 Takashi Iwai 2015-08-25 07:43:41 UTC
(In reply to Tomáš Chvátal from comment #8)
> (In reply to Takashi Iwai from comment #7)
> > The recent update broke my machine after updating Tumbleweed.
> > Now it got an empty /etc/HOSTNAME and the old one was stored in
> > /etc/HOSTNAME.rpmorig.  And hostname command returns "localhost".
> > 
> > Meanwhile /etc/hostname (and /etc/hostname.rpmorig) contain the right string.
> 
> Can't reproduce on any of the testing Factory deploiments I have.
> 
> Any insight on how the layout was done before you updated?
> Eg. HOSTNAME being proper symlink to hostname or something special, etc etc.

No, /etc/HOSTNAME is a normal file.
I can reproduce this by reinstalling netcfg.

% cat /etc/HOSTNAME
alsa1.suse.de

% zypper in -f netcfg
....
(1/1) Installing: netcfg-11.5-30.1 .......................................[done]
Additional rpm output:
warning: /etc/aliases created as /etc/aliases.rpmnew
warning: /etc/defaultdomain created as /etc/defaultdomain.rpmnew
warning: /etc/exports created as /etc/exports.rpmnew
warning: /etc/hostname saved as /etc/hostname.rpmorig
warning: /etc/hosts created as /etc/hosts.rpmnew
warning: /etc/hosts.equiv created as /etc/hosts.equiv.rpmnew

% cat /etc/HOSTNAME
Comment 10 Tomáš Chvátal 2015-08-25 07:49:12 UTC
(In reply to Takashi Iwai from comment #9)
> (In reply to Tomáš Chvátal from comment #8)
> > (In reply to Takashi Iwai from comment #7)
> > > The recent update broke my machine after updating Tumbleweed.
> > > Now it got an empty /etc/HOSTNAME and the old one was stored in
> > > /etc/HOSTNAME.rpmorig.  And hostname command returns "localhost".
> > > 
> > > Meanwhile /etc/hostname (and /etc/hostname.rpmorig) contain the right string.
> > 
> > Can't reproduce on any of the testing Factory deploiments I have.
> > 
> > Any insight on how the layout was done before you updated?
> > Eg. HOSTNAME being proper symlink to hostname or something special, etc etc.
> 
> No, /etc/HOSTNAME is a normal file.
> I can reproduce this by reinstalling netcfg.
> 
> % cat /etc/HOSTNAME
> alsa1.suse.de
> 
> % zypper in -f netcfg
> ....
> (1/1) Installing: netcfg-11.5-30.1
> .......................................[done]
> Additional rpm output:
> warning: /etc/aliases created as /etc/aliases.rpmnew
> warning: /etc/defaultdomain created as /etc/defaultdomain.rpmnew
> warning: /etc/exports created as /etc/exports.rpmnew
> warning: /etc/hostname saved as /etc/hostname.rpmorig
> warning: /etc/hosts created as /etc/hosts.rpmnew
> warning: /etc/hosts.equiv created as /etc/hosts.equiv.rpmnew
> 
> % cat /etc/HOSTNAME

Okay, where came from the HOSTNAME as file, it is not supposed to be such since SLE12.

Anyway will test it out here as it still should kinda converted it correctly and not bork like this.
Comment 11 Tomáš Chvátal 2015-08-25 07:53:20 UTC
And seems I am still unable to reproduce it even if I hand create HOSTNAME file

Before:

scarabeus@bugaboo: /etc $ ll |grep hostname
-rw-r--r-- 1 root root      16 25. srp 09.25 hostname
scarabeus@bugaboo: /etc $ ll |grep HOSTNAME 
-rw-r--r-- 1 root root      19 25. srp 09.50 HOSTNAME

After:

scarabeus@bugaboo: /etc $ ll |grep hostname
-rw-r--r-- 1 root root      19 25. srp 09.52 hostname
lrwxrwxrwx 1 root root       8 25. srp 09.51 HOSTNAME -> hostname


It even carries over different value from HOSTNAME to hostname as you can see...
Comment 12 Takashi Iwai 2015-08-25 08:07:44 UTC
Hmm, it's working for me, too.

Wait...  Maybe there was no /etc/hostname beforehand or empty, only /etc/HOSTNAME existed and contained the string.  Then after update, it's linked to the empty new /etc/hostname.  This sounds feasible?
Comment 13 Takashi Iwai 2015-08-25 08:30:29 UTC
(In reply to Takashi Iwai from comment #12)
> Hmm, it's working for me, too.
> 
> Wait...  Maybe there was no /etc/hostname beforehand or empty, only
> /etc/HOSTNAME existed and contained the string.  Then after update, it's
> linked to the empty new /etc/hostname.  This sounds feasible?

Now it's broken again, but in a different way from what I wrote.

I have an empty /etc/hostname and HOSTNAME is symlinked:
% ls -l /etc/hostname
-rw-r--r-- 1 root root 0 Aug 21 09:02 /etc/hostname
% ls -l /etc/HOSTNAME
lrwxrwxrwx 1 root root 8 Aug 21 09:02 /etc/HOSTNAME -> hostname


Then set a name string:
% echo alsa1.suse.de > /etc/hostname
% ls -l /etc/hostname
-rw-r--r-- 1 root root 14 Aug 25 10:27 /etc/hostname

And update:
% zypper in -f netcfg
....
(1/1) Installing: netcfg-11.5-30.1 .......................................[done]
Additional rpm output:
warning: /etc/aliases created as /etc/aliases.rpmnew
warning: /etc/defaultdomain created as /etc/defaultdomain.rpmnew
warning: /etc/exports created as /etc/exports.rpmnew
warning: /etc/hostname saved as /etc/hostname.rpmorig
warning: /etc/hosts created as /etc/hosts.rpmnew
warning: /etc/hosts.equiv created as /etc/hosts.equiv.rpmnew

It's gone again:
% ls -l /etc/hostname
-rw-r--r-- 1 root root 0 Aug 21 09:02 /etc/hostname

% cat /etc/hostname
Comment 14 Tomáš Chvátal 2015-08-25 09:43:51 UTC
Cra* that indeed is a bug.

Fixed by sr#326599.