Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 259373

Summary: net.eth0 symlink lost on upgrade from baselayout-1.12.11.1 to 2.0.0
Product: Gentoo Linux Reporter: kavol
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WORKSFORME    
Severity: normal CC: jer, roy
Priority: High    
Version: 2006.1   
Hardware: All   
OS: Linux   
URL: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2_pre9
Whiteboard:
Package list:
Runtime testing required: ---

Description kavol 2009-02-17 15:48:19 UTC
Hi.

Recently, I decided to try some new software, and due to dependencies, it seemed to me that it *might* be easier to go ~arch. Note that I have upgraded a lot of packages at once, so I really do not know which one is guilty, blaming baselayout is just my guess.

After rebooting, I have found that the network is down, and the cause was that the initscript /etc/init.d/net.eth0 was missing (while net.eth1 remained untouched). After symlinking net.eth0 to net.lo, everything worked just as before.

I see that this problem is mentioned in the Changelog for baselayout, and that there is some code within the old ebuild to handle net.eth0, but it looks like it haven't worked for me. So please re-examine the fix - I wouldn't really like to see my server (that I have limited physical access to) offline on first reboot after baselayout-2 getting stable ;-)

Reproducible: Always
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2009-02-18 21:19:40 UTC
This bit of code from openrc-0.4.3-r1.ebuild is the alleged culprit:

    # force net init.d scripts into symlinks
    for f in "${ROOT}"/etc/init.d/net.* ; do
        [[ -e ${f} ]] || continue # catch net.* not matching anything
        [[ ${f} == */net.lo ]] && continue # real file now
        [[ ${f} == *.openrc.bak ]] && continue
        if [[ ! -L ${f} ]] ; then
            elog "Moved net service '${f##*/}' to '${f##*/}.openrc.bak' to force a symlink."
            elog "You should delete '${f##*/}.openrc.bak' if you don't need it."
            mv "${f}" "${f}.openrc.bak"
            ln -snf net.lo "${f}"
        fi
    done

As you can see, it moves anything /etc/init.d/net.* (except .lo) that is not a symlink. And it warns you about it in the elog output. This is important because using a copy of net.lo and then upgrading to baselayout 2 / openrc would leave you with an incompatible script which would be as unusable as no script at all. This is a special support case, because as the URL points out, you should create symlinks and not copies.

If you find that the above code failed in any way, then please post your `emerge --info' in a comment and reopen this bug report.
Comment 2 kavol 2009-02-26 12:53:52 UTC
(In reply to comment #1)
> This bit of code from openrc-0.4.3-r1.ebuild is the alleged culprit:
...

I tried another machine; before upgrading, I made sure that /etc/init.d/net.eth0 is a symlink to net.lo and not a copy of it

the upgrade process got interrupted, the new version of openrc was installed but there was the old baselayout (its upgrade was first on the list after issuing emerge -avuDN world again) ... so that I looked into /etc/init.d and the net.eth0 symlink was still there - but it disappeared after finishing the upgrade

so we may rule out openrc, but as the symlink got removed again (the bug was reproduced), I reopen this


reading the ebuild - baselayout-1.12.11.1.ebuild

pkg_prerm() {
        # Older baselayout installed a net.eth0 link by default
        # which means during an upgrade, that link gets lost
        if has_version '=sys-apps/baselayout-2*' && [[ -L ${ROOT}/etc/init.d/net.eth0 ]] ; then
                readlink "${ROOT}"/etc/init.d/net.eth0 > "${T}"/carry-the-0
        else
                rm -f "${T}"/carry-the-0
        fi
}

so, it tries to preserve /etc/init.d/net.eth0 symlink only if it exists AND if has_version '=sys-apps/baselayout-2*' is true

but reading http://devmanual.gentoo.org/function-reference/query-functions/index.html
"has_version pkg    True if pkg (can include version specifiers) is installed."

is that true? i.e. is =sys-apps/baselayout-2* considered installed already at the moment of the abovementioned test?
(this is the only thing which comes to my mind looking at the code ... sorry, I don't have good debugging skills ...)


# emerge --info
Portage 2.2_rc23 (default/linux/amd64/2008.0/desktop, gcc-4.3.3, glibc-2.9_p20081201-r2, 2.6.28-gentoo-r1 x86_64)
=================================================================
System uname: Linux-2.6.28-gentoo-r1-x86_64-AMD_Athlon-tm-_64_Processor_3000+-with-glibc2.2.5
Timestamp of tree: Thu, 26 Feb 2009 02:35:01 +0000
distcc 3.1 x86_64-pc-linux-gnu [disabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p48-r1
dev-java/java-config: 1.3.7-r1, 2.1.7
dev-lang/python:     2.5.4-r2
dev-util/ccache:     2.4-r8
dev-util/cmake:      2.6.2-r1
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.4.3-r1
sys-apps/sandbox:    1.3.8
sys-devel/autoconf:  2.13, 2.63
sys-devel/automake:  1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.2
sys-devel/binutils:  2.19.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.28-r1
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=k8 -pipe -ggdb"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/eselect/postgresql /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-O2 -march=k8 -pipe -ggdb"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache collision-protect distlocks fixpackages parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="cs_CZ.UTF-8"
LC_ALL="cs_CZ.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="cs"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage/layman/science /usr/local/portage/layman/sunrise /root/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext PP1300W X a52 aac accessibility acpi aiglx alsa amd64 amr amrnb amrwb aotuv apache2 asf audiofile avi berkdb bluetooth branding bzip2 cairo calendar cddb cdparanoia cdr cli cracklib crypt css cups dbus dga divx4linux doc dri dv dvd dvdr dvdread emboss encode evo exif fam ffmpeg flac font-server fortran ftp gdbm geoip geos gif gimp gphoto2 gpm gs hal hdri iconv ieee1394 imdb imlib ipv6 irmc isdnlog java javascript jingle jpeg jpeg2k kde kdeenablefinal kdehiddenvisibility kdexdeltas lame lcms ldap libnotify libsamplerate logrotate mad midi mikmod mjpeg mmx mmxext modplug mp3 mp4 mpeg mplayer mudflap multilib ncurses nls nodrm nptl nptlonly nsplugin nvidia ogg opengl openmp pam pcre pdf perl png ppds pppd proj python qt3 qt3support qt4 quicktime readline reflection reiserfs rtc scanner scenarios scrobbler sdl session slang sndfile sound sox spell spl sse sse2 ssl startup-notification subversion svg symlink sysfs tcpd tetex theora threads tiff timidity truetype unicode usb v4l v4l2 vcd vorbis wma x264 xcomposite xface xine xml xorg xulrunner xv xvid xvmc yaz zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="cs" USERLAND="GNU" VIDEO_CARDS="radeon vesa"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 SpanKY gentoo-dev 2009-10-11 09:40:18 UTC
yes, the has_version test is correct

dont interrupt upgrade processes