Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 10681 - baselayout emerge doesn't take care of all existing net.eth*
Summary: baselayout emerge doesn't take care of all existing net.eth*
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High critical (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
: 29730 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-11-13 08:08 UTC by Alessandro Pisani
Modified: 2004-05-07 15:53 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alessandro Pisani 2002-11-13 08:08:50 UTC
updating baselayout, emerge will only replace /etc/init.d/net.eth0 : if you have
more than a ethernet interface the older scripts net.ethX (with 1<=X<=N) won't
get updated causing ethernet interface ifup to fail at boot.
ebuild file should copy net.eth0 to net.ethX during install.
probably the same happens for ppp0, but i dom't know since i do not have more
than one ppp interface.

tested with baselayout-1.8.4.2
Comment 1 Sven Vermeulen (RETIRED) gentoo-dev 2002-11-20 06:58:44 UTC
This is hardly necessary. Since net.eth0, net.eth1, ... don't differ from each
other, you may safely have symlinks pointing to net.eth0.
/etc/init.d/net.eth0
/etc/init.d/net.eth1 -> net.eth0
/etc/init.d/net.eth2 -> net.eth0

This way, there is no need for some special way of handling net.ethX.
Comment 2 Alessandro Pisani 2002-12-17 08:39:12 UTC
i tested using symlinks to net.eth0 but it seems to me to cause some problems at
next reboot when baselayout package gets updated (this is what happed to
me...removing the links solved the problem).
i still think modifying the ebuild file to take care of net.ethX would be the
best solution...
Comment 3 Alessandro Pisani 2003-01-05 16:54:07 UTC
I suggest to add the following (or something like this...) to the ebuild script,
in the pkg_postinstall section:

eth="`ls /etc/init.d/net.eth*`"
for _g in $_eth; do
    _t="`echo $_g | cut -c 20-`"

    if [ $_t != "0" ]; then
        rm /etc/init.d/net.eth${_t}
        cp /etc/init.d/net.eth0 /etc/init.d/net.eth{_t}
    fi
done

ppp="`ls /etc/init.d/net.ppp*`"
for _g in $_ppp; do
    _t="`echo $_g | cut -c 20-`"

    if [ $_t != "0" ]; then
        rm /etc/init.d/net.ppp${_t}
        cp /etc/init.d/net.ppp0 /etc/init.d/net.ppp{_t}
    fi
done


bye,
Alessandro
Comment 4 Wout Mertens (RETIRED) gentoo-dev 2003-03-19 05:57:04 UTC
I tried using symlinks, but the first thing runscript.sh does is running readlink and basing $IFACE 
on that, making it try to bring up eth0. I guess this is necessary for reading config files for linked 
scripts, but in this case it's annoying. Runscript.sh should only use readlink if $0 is not in 
/etc/init.d, and it should actually keep running readlink until it gets something in /etc/init.d or until 
it is no longer a symlink. 
 
So please fix runscript.sh so that we can symlink and this bug is fixed :) 
 
An alternative would be to have support for arguments for the initscripts, then we would just run 
/etc/init.d/net iface=eth1 start. But that would be difficult for all the other scripts, I guess. 
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2003-03-21 02:04:52 UTC
I did ask somebody some time ago (who also biatched :P) to test it without
the readlink, and come back to me.  Unfortunately he (and who he was) vanished ;)

Try it, let me know its fine, and we can fix it.
Comment 6 Alessandro Pisani 2003-04-27 07:54:31 UTC
any work on this?
Comment 7 SpanKY gentoo-dev 2003-08-11 17:03:46 UTC
martin said to modify your runscipt.sh files to not use readlink if the file is in 
/etc/init.d and tell him how it works out 
 
in other words, if you want to see progress, give him some feedback ;) 
Comment 8 Alessandro Pisani 2003-09-12 15:35:06 UTC
martin: what I need to change in runscript.sh to test your solution? let me know: i'm available for testing it out.

alessandro
Comment 9 SpanKY gentoo-dev 2003-09-27 10:44:51 UTC
*** Bug 29730 has been marked as a duplicate of this bug. ***
Comment 10 Derk W te Bokkel 2003-11-13 16:29:41 UTC
I don't see this as a bug but as a feature ... it saved my bacon with bug # 33272
having an old version of net.eth1 arround allowed me to re-establish connectivity .. by copying it over the newer faulty net.eth0 ..

derk
Comment 11 Aron Griffis (RETIRED) gentoo-dev 2004-05-07 15:53:21 UTC
Okay, two issues in this bug:

1. When updating, baselayout doesn't copy net.eth0 to net.ethX.  This isn't going to happen... you should just use symlinks as was mentioned by a few people.  If you're paranoid that net.eth0 will break, then you should keep some binary packages of baselayout around or cook up some other solution.

2. When net.eth1 is a symlink to net.eth0, then it would resolve the link and attempt to start/stop eth0.  This was fixed 9 months, 2 weeks ago by azarah in revision 1.24 of rc-scripts

So this bug is resolved...