Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 425130 - >=sys-apps/openrc-0.9.9 default route fails on network boot
Summary: >=sys-apps/openrc-0.9.9 default route fails on network boot
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-07 05:29 UTC by Matthew Schultz
Modified: 2013-04-26 19:32 UTC (History)
1 user (show)

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


Attachments
rc-0.9.8.4.log (rc-0.9.8.4.log,1.85 KB, text/plain)
2012-07-09 04:01 UTC, Matthew Schultz
Details
rc-0.10.5.log (rc-0.10.5.log,2.71 KB, text/plain)
2012-07-09 04:02 UTC, Matthew Schultz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Schultz 2012-07-07 05:29:06 UTC
The default route fails to add when booting my diskless nfs root machine as of >=sys-apps/openrc-0.9.9.  I have tested 0.10.5 as well and the same problem is exhibited in that version as well so it appears some kind of regression was introduced in 0.9.9.  openrc-0.9.8.4 is the last functional version that does not have this problem.

Reproducible: Always

Actual Results:  
route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
loopback        -               255.0.0.0       !     0      -        0 -
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0


Expected Results:  
route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gimli.home      0.0.0.0         UG    0      0        0 eth0
loopback        localhost       255.0.0.0       UG    0      0        0 lo
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0


cat /etc/conf.d/net
# This blank configuration will automatically use DHCP for any net.*
# scripts in /etc/init.d.  To create a more complete configuration,
# please review /etc/conf.d/net.example and save your configuration
# in /etc/conf.d/net (this file :]!).

#Ethernet
config_eth0="noop"
dns_domain_lo="frodo.home"
dns_search_lo="gandalf.home"
dns_servers_lo="192.168.0.11 192.168.0.1"
ifdown_eth0="NO"

ethtool -s eth0 wol g

emerge --info
Portage 2.1.10.65 (default/linux/amd64/10.0, gcc-4.5.3, glibc-2.13-r4, 3.4.4-gentoo x86_64)
=================================================================
System uname: Linux-3.4.4-gentoo-x86_64-AMD_Athlon-tm-_II_X2_235e_Processor-with-gentoo-2.1
Timestamp of tree: Thu, 05 Jul 2012 20:00:01 +0000
app-shells/bash:          4.2_p20
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.6
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.4 (virtual/os-headers)
sys-libs/glibc:           2.13-r4
Repositories: gentoo mythtv x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=amdfam10 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles metadata-transfer news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.cites.uiuc.edu/pub/gentoo/ http://gentoo.mirrors.easynews.com/linux/gentoo/ http://mirror.phy.olemiss.edu/mirror/gentoo"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en ru"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/mythtv_portage/Gentoo /usr/local/portage"
SYNC="rsync://rsync.namerica.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac accessibility acl acpi alsa amd64 apm ass async audiofile avi bcmath berkdb bluetooth bzip2 cairo calendar caps cddb cjk clamav cli consolekit cracklib crypt ctype curl curlwrappers cxx dbus deflate dga dio directfb dri dts dvb dvd dvdread emu-linux-x86 enca encode exif fbcon ffmpeg fftw flac fortran ftp gd gdbm gif gimp gmp gnutls gpm gstreamer gzip hal hash iconv id3 ieee1394 imagemagick imlib innodb ithreads java javascript jpeg jpeg2k json kipi lcms libcaca libv4l live lm_sensors logrotate lzo mad matroska mcal mhash mime mjpeg mmx mmxext mng modules mp3 mp4 mpeg mplayer msession mudflap multilib mysql mythtv ncurses network nls nptl nptlonly nsplugin nvidia ogg openal opengl openmp openssl oss pam pcntl pcre pdf pdo pear perl pgo png posix ppds pppd pvr python qt qt3 qt3support qt4 quicktime readline reflection sasl sdl sensord session simplexml soap sockets spell spl sse sse2 ssl subversion suhosin svg syslog tcpd theora threads thumbnail tidy tiff tokenizer transcode truetype udev unicode urandom usb utempter v4l v4l2 vcd vdpau vorbis wddx webkit wxwindows x264 xcb xforms xine xinetd xml xml2 xorg xpm xprint xv xvid zip zlib" ALSA_CARDS="hda-intel intel8x0" 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 authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en ru" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 William Hubbs gentoo-dev 2012-07-08 16:46:52 UTC
Please attach /var/log/rc.log of your system booting.

Thanks,

William
Comment 2 Matthew Schultz 2012-07-09 04:01:37 UTC
Created attachment 317642 [details]
rc-0.9.8.4.log

rc.log using 0.9.8.4
Comment 3 Matthew Schultz 2012-07-09 04:02:04 UTC
Created attachment 317644 [details]
rc-0.10.5.log

rc.log using 0.10.5
Comment 4 Matthew Schultz 2012-07-09 04:02:23 UTC
rc-update show
                acpid |      default                                  
            alsasound | boot                                          
          consolefont | boot                                          
         cpufrequtils |      default                                  
                 dbus |      default                                  
                devfs |                                        sysinit
                dmesg |                                        sysinit
             hostname | boot                                          
              keymaps | boot                                          
            killprocs |                        shutdown               
                local |      default nonetwork                        
             mount-ro |                        shutdown               
                 mtab | boot                                          
           ntp-client |      default                                  
                 ntpd |      default                                  
            savecache |                        shutdown               
                 sshd |      default                                  
            syslog-ng |      default                                  
                 udev |                                        sysinit
       udev-postmount |      default
Comment 5 William Hubbs gentoo-dev 2012-08-21 20:54:23 UTC
(In reply to comment #4)

The first thing I notice is that you do not have any network scripts in any runlevels.

You should at least have net.lo in the boot runlevel.
Comment 6 Matthew Schultz 2012-08-21 21:24:19 UTC
(In reply to comment #5)
> (In reply to comment #4)
> 
> The first thing I notice is that you do not have any network scripts in any
> runlevels.
> 
> You should at least have net.lo in the boot runlevel.

Once again this is a network booting machine using nfs as root with the filesystem residing on another machine.  The eth0 interface is already up since it has to be to be able to boot off the network.  Enabling it fails anyway on 0.10.5 since I already tried that when I upgraded openrc.  The lo interface already comes up automatically so it's not needed either.  Again this set up works fine under openrc-0.9.8.4 but not under later versions.
Comment 7 Matthew Schultz 2012-08-21 21:31:41 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > (In reply to comment #4)
> > 
> > The first thing I notice is that you do not have any network scripts in any
> > runlevels.
> > 
> > You should at least have net.lo in the boot runlevel.
> 
> Once again this is a network booting machine using nfs as root with the
> filesystem residing on another machine.  The eth0 interface is already up
> since it has to be to be able to boot off the network.  Enabling it fails
> anyway on 0.10.5 since I already tried that when I upgraded openrc.  The lo
> interface already comes up automatically so it's not needed either.  Again
> this set up works fine under openrc-0.9.8.4 but not under later versions.

Also note this in the rc.log:

 *   root filesystem is network mounted -- can't stop lo
 * ERROR: net.lo failed to stop

This doesn't affect anything but it would be nice if openrc didn't attempt to stop lo since it can't stop it anyway due to the root filesystem being network mounted.  This is one of the reasons why I don't have net.lo set to start/stop, since openrc doesn't have the ability to control that in this scenario and yet it tries to stop it anyway.
Comment 8 Benda Xu gentoo-dev 2012-08-24 22:30:05 UTC
Hi, Matthew. Thanks a lot for reporting the bug.

The cause is that netmount needs "net", 

# /etc/init.d/netmount ineed
... net.wlan0...

(this is my box, in yours it should be "network" instead of "net.wlan0")

which is provided by "network" in your box.

# /etc/init.d/network iprovide
net 

And you want to tell OpenRC "hey you should not try to set up network for me, it is already there!" One way to do that is to put

rc_provide="net"
rc_depend_strict="NO" # this defaults to NO already

into /etc/rc.conf, you can read the comments around rc.conf to get the idea.

Have a try. I hope this can provide a solution.
Comment 9 William Hubbs gentoo-dev 2012-08-25 00:09:42 UTC
(In reply to comment #8)
> Hi, Matthew. Thanks a lot for reporting the bug.
> 
> The cause is that netmount needs "net", 
> 
> # /etc/init.d/netmount ineed
> ... net.wlan0...
> 
> (this is my box, in yours it should be "network" instead of "net.wlan0")
> 
> which is provided by "network" in your box.
> 
> # /etc/init.d/network iprovide
> net 

This will be fixed in openrc-0.11 when we only install network if you have the "newnet" use flag turned on.

> And you want to tell OpenRC "hey you should not try to set up network for
> me, it is already there!" One way to do that is to put
> 
> rc_provide="net"

Actually, this is the line that would go in /etc/conf.d/network:

rc_provide="!net"

Then, for every service that fails because net doesn't start, you must add the following line to /etc/conf.d/<service>:

rc_need="!net"
Comment 10 Matthew Schultz 2012-08-25 02:16:48 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Hi, Matthew. Thanks a lot for reporting the bug.
> > 
> > The cause is that netmount needs "net", 
> > 
> > # /etc/init.d/netmount ineed
> > ... net.wlan0...
> > 
> > (this is my box, in yours it should be "network" instead of "net.wlan0")
> > 
> > which is provided by "network" in your box.
> > 
> > # /etc/init.d/network iprovide
> > net 
> 
> This will be fixed in openrc-0.11 when we only install network if you have
> the "newnet" use flag turned on.
> 
> > And you want to tell OpenRC "hey you should not try to set up network for
> > me, it is already there!" One way to do that is to put
> > 
> > rc_provide="net"
> 
> Actually, this is the line that would go in /etc/conf.d/network:
> 
> rc_provide="!net"
> 
> Then, for every service that fails because net doesn't start, you must add
> the following line to /etc/conf.d/<service>:
> 
> rc_need="!net"


(In reply to comment #9)
> (In reply to comment #8)
> > Hi, Matthew. Thanks a lot for reporting the bug.
> > 
> > The cause is that netmount needs "net", 
> > 
> > # /etc/init.d/netmount ineed
> > ... net.wlan0...
> > 
> > (this is my box, in yours it should be "network" instead of "net.wlan0")
> > 
> > which is provided by "network" in your box.
> > 
> > # /etc/init.d/network iprovide
> > net 
> 
> This will be fixed in openrc-0.11 when we only install network if you have
> the "newnet" use flag turned on.
> 
> > And you want to tell OpenRC "hey you should not try to set up network for
> > me, it is already there!" One way to do that is to put
> > 
> > rc_provide="net"
> 
> Actually, this is the line that would go in /etc/conf.d/network:
> 
> rc_provide="!net"
> 
> Then, for every service that fails because net doesn't start, you must add
> the following line to /etc/conf.d/<service>:
> 
> rc_need="!net"


I upgraded to 0.10.5 again by specifying this in /etc/init.d/network:

rc_provide="!net"

That worked.  So I guess some configuration must have changed in 0.9.9 that was different from 0.9.8.4.  I did not need rc_need="!net" either. This works better though since it doesn't bring lo up or down:

route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gimli.home      0.0.0.0         UG    0      0        0 eth0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0


To answer the other question, this is the output now that I changed to rc_provide="!net" in /etc/conf.d/network:


# /etc/init.d/netmount ineed
staticroute

# /etc/init.d/network iprovide
(blank line here)

I'm not sure what staticroute is for and is probably also not necessary but since it mentions it's deprecated in the rc.log, it's probably not an issue.
Comment 11 William Hubbs gentoo-dev 2012-09-07 21:11:00 UTC
To answer your question about staticroute, this is the part of the
newnet scripts which sets up all of the static routes. It is not
deprecated; it is just not supposed to be installed unless you are using
it.

Since you were able to find a fix, I an closing this worksforme. If
there is still an issue, please feel free to re-open.
Comment 12 Matthew Schultz 2012-09-07 21:23:53 UTC
(In reply to comment #11)
> To answer your question about staticroute, this is the part of the
> newnet scripts which sets up all of the static routes. It is not
> deprecated; it is just not supposed to be installed unless you are using
> it.
> 

If it's not deprecated, why does the rc.log say it is?
Comment 13 William Hubbs gentoo-dev 2012-09-08 16:18:05 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > To answer your question about staticroute, this is the part of the
> > newnet scripts which sets up all of the static routes. It is not
> > deprecated; it is just not supposed to be installed unless you are using
> > it.
> > 
> 
> If it's not deprecated, why does the rc.log say it is?

Because I was planning on removing it. However, I have since found that people do use newnet, and I have found a way to not install it if it is not being used.
Comment 14 William Hubbs gentoo-dev 2013-04-26 19:32:47 UTC
I believe this will be taken care of by OpenRC having a separate script
to start the loopback interface. It also will not try to stop the
loopback interface any longer.