[Bug 883999] New: hostname lost while zypper dup from 13.1 to Factory
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c0 Summary: hostname lost while zypper dup from 13.1 to Factory Classification: openSUSE Product: openSUSE Factory Version: 13.2 Milestone 0 Platform: x86-64 OS/Version: openSUSE 13.2 Status: NEW Severity: Major Priority: P5 - None Component: Basesystem AssignedTo: pgajdos@suse.com ReportedBy: lmuelle@suse.com QAContact: qa-bugs@suse.de Found By: Development Blocker: No lmuelle@hip:~> LC_ALL=POSIX ls -l /etc/{hostname,HOSTNAME} lrwxrwxrwx 1 root root 8 Jun 20 20:18 /etc/HOSTNAME -> hostname -rw-r--r-- 1 root root 11 Jun 18 11:01 /etc/hostname lmuelle@hip:~> cat /etc/hostname linux.site There is no rpmsave while /etc/HOSTNAME before was set to hip.suse.de -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c Petr Gajdos <pgajdos@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium Status|NEW |ASSIGNED -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c1 Petr Gajdos <pgajdos@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO InfoProvider| |fcrozat@suse.com --- Comment #1 from Petr Gajdos <pgajdos@suse.com> 2014-06-24 14:59:09 UTC --- So the /etc/HOSTNAME link should be marked as %config, correct? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c2 Felix Miata <mrmazda@earthlink.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mrmazda@earthlink.net Summary|hostname lost while zypper |hostname lost while zypper |dup from 13.1 to Factory |dup from 13.1 to Factory or | |zypper dup of Factory --- Comment #2 from Felix Miata <mrmazda@earthlink.net> 2014-06-25 22:31:54 EDT --- On Factory installation last dup'd 5 weeks ago, HOSTNAME was replaced with symlink to hostname containing linux.site without regard to original content of HOSTNAME during today's zypper dup (4 bit host hs80e). -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c3 --- Comment #3 from Petr Gajdos <pgajdos@suse.com> 2014-06-26 15:03:10 UTC --- %pre if [ "0$1" -ge "2" ]; then if [ -f /etc/HOSTNAME -a ! -h /etc/HOSTNAME ]; then if [ -f /etc/hostname ]; then mv /etc/hostname /etc/hostname.rpmsave fi mv /etc/HOSTNAME /etc/HOSTNAME.rpmsave fi fi %post if [ -f /etc/HOSTNAME.rpmsave ]; then cp /etc/HOSTNAME.rpmsave /etc/hostname fi could work? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c4 Petr Gajdos <pgajdos@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sbrabec@suse.com --- Comment #4 from Petr Gajdos <pgajdos@suse.com> 2014-06-27 10:27:47 UTC --- Standa Brabec pointed out that there can be various setups according to /etc/{HOSTNAME,hostname} on the original system before the update. I tested %pre/%post from comment 3 like this: (1) There is /etc/HOSTNAME only. -------------------------------- $ ls -l /etc | grep -i hostname -rw-r--r-- 1 root root 11 Jun 26 12:44 HOSTNAME $ echo bleble > /etc/HOSTNAME $ rpm -Uhv netcfg-11.5-0.noarch.rpm --force $ ls -l /etc | grep -i hostname lrwxrwxrwx 1 root root 8 Jun 27 09:50 HOSTNAME -> hostname -rw-r--r-- 1 root root 7 Jun 27 09:47 HOSTNAME.rpmsave -rw-r--r-- 1 root root 7 Jun 27 09:50 hostname $ cat /etc/hostname bleble (2) There is /etc/HOSTNAME and /etc/hostname link to /etc/HOSTNAME. ------------------------------------------------------------------- $ ls -l /etc | grep -i hostname -rw-r--r-- 1 root root 7 Jun 27 10:01 HOSTNAME lrwxrwxrwx 1 root root 13 Jun 27 10:02 hostname -> /etc/HOSTNAME $ echo bleble > /etc/HOSTNAME $ rpm -Uhv netcfg-11.5-0.noarch.rpm --force $ ls -l /etc | grep -i hostname lrwxrwxrwx 1 root root 8 Jun 27 10:04 HOSTNAME -> hostname -rw-r--r-- 1 root root 7 Jun 27 10:02 HOSTNAME.rpmsave -rw-r--r-- 1 root root 7 Jun 27 10:04 hostname -rw-r--r-- 1 root root 11 Jun 27 09:13 hostname.rpmnew lrwxrwxrwx 1 root root 13 Jun 27 10:02 hostname.rpmsave -> /etc/HOSTNAME alef:/> cat /etc/hostname bleble (3) There is /etc/HOSTNAME and /etc/hostname, both regular files. ----------------------------------------------------------------- Unlikely, /etc/HOSTNAME and /etc/hostname can differ but that would mean conflict between them. $ ls -l /etc | grep -i hostname -rw-r--r-- 1 root root 16 Jun 27 10:09 HOSTNAME -rw-r--r-- 1 root root 16 Jun 27 10:09 hostname $ echo bleble.HOSTNAME > /etc/HOSTNAME $ echo bleble.hostname > /etc/hostname $ rpm -Uhv netcfg-11.5-0.noarch.rpm --force $ ls -l /etc | grep -i hostname lrwxrwxrwx 1 root root 8 Jun 27 10:11 HOSTNAME -> hostname -rw-r--r-- 1 root root 16 Jun 27 10:09 HOSTNAME.rpmsave -rw-r--r-- 1 root root 16 Jun 27 10:11 hostname -rw-r--r-- 1 root root 11 Jun 27 09:13 hostname.rpmnew -rw-r--r-- 1 root root 16 Jun 27 10:09 hostname.rpmsave $ cat /etc/hostname bleble.HOSTNAME (4) There is /etc/hostname and /etc/HOSTNAME, link to /etc/hostname. -------------------------------------------------------------------- $ ls -l /etc | grep -i hostname lrwxrwxrwx 1 root root 13 Jun 27 10:18 HOSTNAME -> /etc/hostname -rw-r--r-- 1 root root 11 Jun 26 12:44 hostname $ echo bleble > /etc/hostname $ ls -l /etc | grep -i hostname lrwxrwxrwx 1 root root 8 Jun 27 10:21 HOSTNAME -> hostname lrwxrwxrwx 1 root root 13 Jun 27 10:18 HOSTNAME.rpmsave -> /etc/hostname -rw-r--r-- 1 root root 7 Jun 27 10:19 hostname -rw-r--r-- 1 root root 11 Jun 27 09:13 hostname.rpmnew $ cat /etc/hostname bleble Does that serve our purpose? Or is there another scenario which would fail? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c5 --- Comment #5 from Petr Gajdos <pgajdos@suse.com> 2014-06-27 10:30:13 UTC --- Standa Brabec suggested yesterday: %pre if [ "0$1" -ge "2" ]; then if [ -f /etc/HOSTNAME -a ! -h /etc/HOSTNAME ]; then mv /etc/HOSTNAME /etc/HOSTNAME.rpmsave fi if [ -h /etc/hostname ]; then rm /etc/hostname fi if [ -f /etc/hostname ]; then touch /etc/hostname.stamp fi fi %post if [ -f /etc/HOSTNAME.rpmsave ]; then if [ -f /etc/hostname.stamp ]; then rm /etc/hostname.stamp if cmp -s /etc/hostname /etc/HOSTNAME.rpmsave; then rm /etc/HOSTNAME.rpmsave else echo "/etc/hostname and /etc/HOSTNAME conflicted before installation" >&2 echo "/etc/hostname saved into /etc/hostname.rpmsave" >&2 mv /etc/hostname /etc/hostname.rpmsave mv /etc/HOSTNAME.rpmsave /etc/hostname fi else mv /etc/hostname /etc/hostname.rpmnew mv /etc/HOSTNAME.rpmsave /etc/hostname fi else # should not happen rm /etc/hostname.stamp fi -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c7 --- Comment #7 from Felix Miata <mrmazda@earthlink.net> 2014-06-27 06:57:24 EDT --- 1: cf. Bug 872264 2: I don't see the following covered by the proposal: -rw-r--r-- 2 root root 13 Dec 23 2013 HOSTNAME -rw-r--r-- 2 root root 13 Dec 23 2013 hostname 3: Why not a hard link of hostname to existing HOSTNAME? 4: One of my pet peeves routinely violated by zypper and yast activity is any file whose content before touching is identical to that after touching and my finding the original timestamp has not survived along with the original content. This very irritating behavior happens constantly to /etc/fstab and various files in /etc/sysconfig/ among others, mostly in the /etc/ tree. Would the renaming of /etc/HOSTNAME to /etc/hostname be another as a result of the proposal? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c8 --- Comment #8 from Stanislav Brabec <sbrabec@suse.com> 2014-06-27 18:40:02 CEST --- 2. The script in the comment 5 should handle it: %pre mv /etc/HOSTNAME /etc/HOSTNAME.rpmsave %post rm /etc/HOSTNAME.rpmsave (After installation, /etc/HOSTNAME will be a symlink. 3. Maybe it is possible as well. But some editors will break the hard link. 4. Time stamp of /etc/HOSTNAME should survive in /etc/hostname. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c9 --- Comment #9 from Felix Miata <mrmazda@earthlink.net> 2014-07-03 03:07:35 EDT --- In order to not have a current timestamp polluting either HOSTNAME or hostname, before doing upgrades I set a hard link from HOSTNAME to hostname, then set HOSTNAME immutable. This halts the upgrade process until I tell it to ignore its inability to create a new HOSTNAME with a current timestamp. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c10 Petr Gajdos <pgajdos@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 - Medium |P2 - High CC| |behlert@suse.com --- Comment #10 from Petr Gajdos <pgajdos@suse.com> 2014-07-21 07:23:58 UTC --- Guys, The change /etc/HOSTNAME -> /etc/hostname + symlink /etc/HOSTNAME do not come from netcfg package, so discussion if it should be hardlink and why we don't maintain timestamps do not belong to this bug, at least to my understanding. See bug 858908 for the reference. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c11 --- Comment #11 from Petr Gajdos <pgajdos@suse.com> 2014-07-21 07:25:34 UTC --- (In reply to comment #10)
The change /etc/HOSTNAME -> /etc/hostname + symlink /etc/HOSTNAME do not come
not come == not initiated by -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c12 --- Comment #12 from Petr Gajdos <pgajdos@suse.com> 2014-07-21 08:24:21 UTC --- (In reply to comment #7)
2: I don't see the following covered by the proposal: -rw-r--r-- 2 root root 13 Dec 23 2013 HOSTNAME -rw-r--r-- 2 root root 13 Dec 23 2013 hostname
What exactly do you think by 'not covered'? That the hardlink hierarchy is not maintained during the update? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c13 --- Comment #13 from Felix Miata <mrmazda@earthlink.net> 2014-07-21 04:55:24 EDT --- (In reply to comment #12)
What exactly do you think by 'not covered'? That the hardlink hierarchy is not maintained during the update?
Yes. Given the extent to which various unchanged config files in the /etc tree get new timestamps when various package updates occur, it would not surprise me, hence the question. What bothers me more is absent using a hardlink between the two, HOSTNAME gets a new create date when hostname gets "created" via mv to HOSTNAME. If it was up to me, the update process would hard link instead of moving, creating a soft link, and leaving behind litter in the form of an .rpmsave or .rpmnew. Better still would be to do no more than a rename, period, dispensing with the HOSTNAME that is pointlessly unique among major distros to openSUSE/SLEx. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c14 --- Comment #14 from Petr Gajdos <pgajdos@suse.com> 2014-07-24 11:30:00 UTC --- Is that better? %pre if [ "0$1" -ge "2" ]; then if [ -f /etc/HOSTNAME -a ! -L /etc/HOSTNAME ]; then if [ -f /etc/hostname ]; then mv /etc/hostname /etc/hostname.rpmsave fi ln -f /etc/HOSTNAME /etc/HOSTNAME.rpmsave rm /etc/HOSTNAME fi fi %post if [ -f /etc/HOSTNAME.rpmsave -a ! -L /etc/HOSTNAME.rpmsave ]; then cp -a /etc/HOSTNAME.rpmsave /etc/hostname fi As far as I tested (similarly like summarized in comment 4): before update: ============== # | /etc/HOSTNAME | /etc/hostname | probability ---|-------------------------------------------- 1. | regular | - | very high 2. | - | regular | very low 3. | regular | symlink | high 4. | symlink | regular | very low 5. | regular | regular | very low 6. | hardlink | hardlink | high after update: ============= 1. lrwxrwxrwx 1 root root 8 Jul 24 09:21 HOSTNAME -> hostname -rw-r--r-- 1 root root 7 Jul 24 09:19 HOSTNAME.rpmsave -rw-r--r-- 1 root root 7 Jul 24 09:19 hostname hostname and HOSTNAME.rpmsave have content and timestamp of original HOSTNAME 2. lrwxrwxrwx 1 root root 8 Jul 23 13:25 HOSTNAME -> hostname -rw-r--r-- 1 root root 7 Jul 23 13:24 hostname -rw-r--r-- 1 root root 11 Jul 23 13:09 hostname.rpmnew hostname untouched 3. lrwxrwxrwx 1 root root 8 Jul 24 09:39 HOSTNAME -> hostname -rw-r--r-- 1 root root 7 Jul 24 09:38 HOSTNAME.rpmsave -rw-r--r-- 1 root root 7 Jul 24 09:38 hostname -rw-r--r-- 1 root root 11 Jul 24 08:51 hostname.rpmnew lrwxrwxrwx 1 root root 13 Jul 24 09:38 hostname.rpmsave -> /etc/HOSTNAME hostname carries the content and timestamp of original HOSTNAME 4. lrwxrwxrwx 1 root root 8 Jul 24 08:55 HOSTNAME -> hostname lrwxrwxrwx 1 root root 13 Jul 24 08:54 HOSTNAME.rpmsave -> /etc/hostname -rw-r--r-- 1 root root 7 Jul 24 08:54 hostname -rw-r--r-- 1 root root 11 Jul 24 08:51 hostname.rpmnew hostname carries the content and timestamp of original HOSTNAME 5. lrwxrwxrwx 1 root root 8 Jul 24 09:46 HOSTNAME -> hostname -rw-r--r-- 1 root root 16 Jul 24 09:44 HOSTNAME.rpmsave -rw-r--r-- 1 root root 16 Jul 24 09:44 hostname -rw-r--r-- 1 root root 11 Jul 24 08:51 hostname.rpmnew -rw-r--r-- 1 root root 16 Jul 24 09:45 hostname.rpmsave *.rpmsave carry contents and timestamps of respective originals hostname carries contents and timestamp of original HOSTNAME 6. lrwxrwxrwx 1 root root 8 Jul 24 09:54 HOSTNAME -> hostname -rw-r--r-- 2 root root 7 Jul 24 09:53 HOSTNAME.rpmsave -rw-r--r-- 1 root root 7 Jul 24 09:53 hostname -rw-r--r-- 1 root root 11 Jul 24 08:51 hostname.rpmnew -rw-r--r-- 2 root root 7 Jul 24 09:53 hostname.rpmsave hostname and *rpmsave carry content and timestamp of original file -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c15 Petr Gajdos <pgajdos@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |ASSIGNED InfoProvider|fcrozat@suse.com | --- Comment #15 from Petr Gajdos <pgajdos@suse.com> 2014-07-24 12:12:54 UTC --- Needinfo provided personally. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c16 --- Comment #16 from Petr Gajdos <pgajdos@suse.com> 2014-07-25 07:19:06 UTC --- *** Bug 887039 has been marked as a duplicate of this bug. *** http://bugzilla.novell.com/show_bug.cgi?id=887039 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c17 Petr Gajdos <pgajdos@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution| |FIXED --- Comment #17 from Petr Gajdos <pgajdos@suse.com> 2014-07-25 10:55:51 UTC --- Package submitted. Please test. If you meet any other problem which I can resolve on netcfg side, please let me know. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c18 --- Comment #18 from Bernhard Wiedemann <bwiedemann@suse.com> 2014-07-25 13:00:16 CEST --- This is an autogenerated message for OBS integration: This bug (883999) was mentioned in https://build.opensuse.org/request/show/242350 Factory / netcfg -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c20 --- Comment #20 from Felix Miata <mrmazda@earthlink.net> 2014-07-28 21:12:33 EDT --- Last 2-3 systems upgraded with HOSTNAME and hostname hard linked survived intact, but I just did host g5eas where HOSTNAME and hostname were hard linked to start with, and afterward HOSTNAME was a currently timestamped symlink to hostname. When I deleted the symlink and recreated the hard link, I wound up with 3 links total, the third to hostname.rpmsave, which I've now deleted. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c21 --- Comment #21 from Felix Miata <mrmazda@earthlink.net> 2014-08-05 23:40:59 EDT --- Ditto, sort of, comment 20 on host gx62b which was last dup'd 24 July. This time there were HOSTNAME.rpmsave and hostname.rpmsave preserved as hard links (to each other?), with timestamp of hostname preserved and with no hard links, while HOSTNAME was a current timestamped symlink to hostname. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=883999 https://bugzilla.novell.com/show_bug.cgi?id=883999#c22 --- Comment #22 from Felix Miata <mrmazda@earthlink.net> 2014-08-17 02:30:12 EDT --- netcfg-11.5-23.1 refuses to install when hostname exists as immutable hard link to HOSTNAME -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=883999 Stephan Kulow <coolo@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |coolo@suse.com -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com