# net.eth0 does not start at boot [SOLVED]

## dageyra

I came to our server to do a kernel upgrade today and when I rebooted, it came to my attention that net.eth0 no longer started at boot.  I know there was the openrc switch (which we have done, all packages in world/system up-to-date) and that it can cause issues with net.eth0.  As it turns out, when the server restarted, net.eth0 was gone (though still in rc default).  I created the symlink to net.lo and rebooted, still no net.eth0 at boot.  I removed net.eth0 from default and re-added, rebooted, net.eth0 does not start at boot.  This of course throws of apache and maybe some others.  Once the server boots up, I can login and start net.eth0 fine, and then apache, and everything proceeds normally.

I found this page and followed the instructions to update rc_hotplug/rc_coldplug (which the page suggests YES, I've tried YES and * as the documentation says):

http://parkersamp.com/2011/05/help-gentoo-installed-openrc-and-net-eth0-wont-start/

Still nothing forces net.eth0 to start at boot.  The net.eth0 normally starts right after net.lo, but instead the boot moves right on, never mentioning net.eth0.

Any suggestions?  Below you can see net.eth0 is set to start at default, that starting net.eth0 manually works (so not a driver issue, I also show the output of lsmod, driver is not built as module so it's available at boot), and the output of rc.conf.  I'm sure we are missing something obvious, but I have to leave the facility soon and would like this resolved before then, so any thoughts?  Thanks for any help you can provide.

net.eth0 can be started manually

```

 # /etc/init.d/net.eth0 restart

 * Bringing down interface eth0

 *   Removing addresses

 *     65.111.253.235/29

 * Bringing up interface eth0

 *   65.111.253.235 ...                                                                                                                                           [ ok ]

 *   65.111.253.236 ...                                                                                                                                           [ ok ]

 *   65.111.253.237 ...                                                                                                                                           [ ok ]

 *   Adding routes

 *     default via 65.111.253.233 ...  

```

No kernel modules configured

```

 # lsmod

Module                  Size  Used by

```

net.eth0 is listed to start at default

```

# rc-update show default

              apache2 | default

                local | default

                mysql | default

                named | default

             net.eth0 | default

             netmount | default

            openrdate | default

              proftpd | default

                 sshd | default

            syslog-ng | default

       udev-postmount | default

           vixie-cron | default

```

/etc/rc.conf output

```

# cat /etc/rc.conf

# Global OpenRC configuration settings

# Set rc_interactive to "YES" and you'll be able to press the I key during

# boot so you can choose to start specific services. Set to "NO" to disable

# this feature.

#rc_interactive="YES"

# If we need to drop to a shell, you can specify it here.

# If not specified we use $SHELL, otherwise the one specified in /etc/passwd,

# otherwise /bin/sh

# Linux users could specify /sbin/sulogin

rc_shell=/sbin/sulogin

# Do we allow any started service in the runlevel to satisfy the dependency

# or do we want all of them regardless of state? For example, if net.eth0

# and net.eth1 are in the default runlevel then with rc_depend_strict="NO"

# both will be started, but services that depend on 'net' will work if either

# one comes up. With rc_depend_strict="YES" we would require them both to

# come up.

#rc_depend_strict="YES"

# rc_hotplug is a list of services that we allow to be hotplugged.

# By default we do not allow hotplugging.

# A hotplugged service is one started by a dynamic dev manager when a matching

# hardware device is found.

# This service is intrinsically included in the boot runlevel.

# To disable services, prefix with a !

# Example - rc_hotplug="net.wlan !net.*"

# This allows net.wlan and any service not matching net.* to be plugged.

# Example - rc_hotplug="*"

# This allows all services to be hotplugged

#rc_hotplug="*"

rc_hotplug="*"

rc_coldplug="*"

# rc_logger launches a logging daemon to log the entire rc process to

# /var/log/rc.log

# NOTE: Linux systems require the devfs service to be started before

# logging can take place and as such cannot log the sysinit runlevel.

#rc_logger="YES"

# Through rc_log_path you can specify a custom log file.

# The default value is: /var/log/rc.log

#rc_log_path="/var/log/rc.log"

# By default we filter the environment for our running scripts. To allow other

# variables through, add them here. Use a * to allow all variables through.

#rc_env_allow="VAR1 VAR2"

# By default we assume that all daemons will start correctly.

# However, some do not - a classic example is that they fork and return 0 AND

# then child barfs on a configuration error. Or the daemon has a bug and the

# child crashes. You can set the number of milliseconds start-stop-daemon

# waits to check that the daemon is still running after starting here.

# The default is 0 - no checking.

#rc_start_wait=100

# rc_nostop is a list of services which will not stop when changing runlevels.

# This still allows the service itself to be stopped when called directly.

#rc_nostop=""

# rc will attempt to start crashed services by default.

# However, it will not stop them by default as that could bring down other

# critical services.

#rc_crashed_stop=NO

#rc_crashed_start=YES

##############################################################################

# MISC CONFIGURATION VARIABLES

# There variables are shared between many init scripts

# Set unicode to YES to turn on unicode support for keyboards and screens.

unicode="YES"

# Below is the default list of network fstypes.

#

# afs cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs

# nfs nfs4 ocfs2 shfs smbfs

#

# If you would like to add to this list, you can do so by adding your

# own fstypes to the following variable.

#extra_net_fs_list=""

##############################################################################

# SERVICE CONFIGURATION VARIABLES

# These variables are documented here, but should be configured in

# /etc/conf.d/foo for service foo and NOT enabled here unless you

# really want them to work on a global basis.

# Some daemons are started and stopped via start-stop-daemon.

# We can set some things on a per service basis, like the nicelevel.

#export SSD_NICELEVEL="-19"

# Pass ulimit parameters

#rc_ulimit="-u 30"

# It's possible to define extra dependencies for services like so

#rc_config="/etc/foo"

#rc_need="openvpn"

#rc_use="net.eth0"

#rc_after="clock"

#rc_before="local"

#rc_provide="!net"

# You can also enable the above commands here for each service. Below is an

# example for service foo.

#rc_foo_config="/etc/foo"

#rc_foo_need="openvpn"

#rc_foo_after="clock"

# You can also remove dependencies.

# This is mainly used for saying which servies do NOT provide net.

#rc_net_tap0_provide="!net"

##############################################################################

# LINUX SPECIFIC OPTIONS

# This is the subsystem type. Valid options on Linux:

# ""        - nothing special

# "lxc"     - Linux Containers

# "openvz"  - Linux OpenVZ

# "prefix"  - Prefix

# "uml"     - Usermode Linux

# "vserver" - Linux vserver

# "xen0"    - Xen0 Domain

# "xenU"    - XenU Domain

# If this is commented out, automatic detection will be attempted.

# Note that autodetection will not work in a prefix environment or in a

# linux container.

#

# This should be set to the value representing the environment this file is

# PRESENTLY in, not the virtualization the environment is capable of.

#rc_sys=""

# This is the number of tty's used in most of the rc-scripts (like

# consolefont, numlock, etc ...)

rc_tty_number=12

```

Baselayout & openrc versions installed:

```

 # emerge -av baselayout openrc

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] sys-apps/baselayout-2.0.3  USE="-build" 0 kB

[ebuild   R    ] sys-apps/openrc-0.9.8.4  USE="ncurses pam unicode -debug (-selinux) -static-libs" 0 kB

Total: 2 packages (2 reinstalls), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] n

```

Last edited by dageyra on Thu May 31, 2012 12:17 pm; edited 1 time in total

----------

## turtles

What version of udev are you running?

Do you have

```
grep 'CONFIG_DEVTMPFS' /usr/src/linux/.config
```

enabled?

EDIT.

Check also udev runlevel:

```
 ls -l /etc/runlevels/sysinit
```

[/quote]

----------

## dageyra

 *turtles wrote:*   

> What version of udev are you running?
> 
> Do you have
> 
> ```
> ...

 

Thanks for the reply.  That config is not enabled, and I'm not familiar with it.

```

# grep 'CONFIG_DEVTMPFS' /usr/src/linux/.config

# CONFIG_DEVTMPFS is not set

```

Concerning udev:

```

# emerge -av udev

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild   R    ] sys-fs/udev-164-r2  USE="-build -extras (-selinux) -test" 0 kB

Total: 1 package (1 reinstall), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No]

```

Here is the sysinit:

```

# ls -l /etc/runlevels/sysinit

total 0

lrwxrwxrwx 1 root root 17 Apr 29 16:41 devfs -> /etc/init.d/devfs

lrwxrwxrwx 1 root root 17 Apr 29 16:41 dmesg -> /etc/init.d/dmesg

```

I'm a bit out of my league here, what exactly have we done wrong?  And more importantly, how should we fix it?  I can see you say we need the kernel config set, so that we can do, anything else?  I'm not at the facility any longer, it's an hour away, but I can plan a trip once a set of fixed steps to resolve the problem are figured out.  Boss wouldn't happy about going back and forth to try out this and that in order to troubleshoot the situation, although this is clearly a major problem.

Thanks for your feedback, it's something new so that's a plus for us right now.

----------

## BillWho

dageyra,

The problems with udev and CONFIG_DEVTMPFS not beiing set started with sys-fs/udev-181, if I remember correctly. Yours is sys-fs/udev-164-r2 so that shouldn't be the cause. However, it wouldn't be a bad idea to set it already.

udev service should be in the sysinit runlevel - I didn't see it in the results of your ls -l /etc/runlevels/sysinit

```
root@gentoo-gateway udev # rc-update show sysinit

                devfs | sysinit

                dmesg | sysinit

                 udev | sysinit

```

Another thing to check is /etc/udev/rules.d/70-persistent-net.rules

When was the last time you did a emerge -uDN ? udev-164-r2 is fairly old  :Exclamation: 

----------

## turtles

 *dageyra wrote:*   

> .... it's an hour away, but I can plan a trip once a set of fixed steps to resolve the problem are figured out.  Boss wouldn't happy about going back and forth to try out this and that in order to troubleshoot the situation, although this is clearly a major problem.

 

I have been admining production Gentoo servers way too long and my strategy is now as follows:

Image or recreate the production system and test changes on a laptop or test box.

No exceptions

config files and kernel everything..

Make sure you get databases, webapps or whatever the server is running.

Then when I and users are happy with the new stable system would set up the test system as a bin host and 

```
emerge -agKUDN world
```

on the production system.

I would do that for security fixes often and update world every 5-10 months.

Or have someone provide this for you for a small fee per upgrade.

OR if you have spare rack space or spare servers switch between production and testing.

Thats what I do here. Server 1 is production for 6 months, then server 2 replaces it.

Then server 1 replaces server 2. 

That way if you run into hardware problems or whatever you can go live with your testing box sooner than planned no big deal. 

 *http://www.gentoo.org/doc/en/openrc-migration.xml wrote:*   

> OpenRC no longer starts udev by default, but it does need to be present in the sysinit runlevel to be started. 

 

for now just add udev to the sysinit run level.

```
rc-update add udev sysinit

```

----------

## dageyra

 *BillWho wrote:*   

> dageyra,
> 
> The problems with udev and CONFIG_DEVTMPFS not beiing set started with sys-fs/udev-181, if I remember correctly. Yours is sys-fs/udev-164-r2 so that shouldn't be the cause. However, it wouldn't be a bad idea to set it already.
> 
> udev service should be in the sysinit runlevel - I didn't see it in the results of your ls -l /etc/runlevels/sysinit
> ...

 

Thank for the reply Bill, and we actually did a systemic upgrade of our 2 servers of the past couple of weeks.  By last week, all emerge world/system had finished with all package updates and GLSA applied.  Your inquiry did lead me into a whole separate area however, since as you say our udev is quite old.  Even doing an emerge udev only wanted to reinstall the package, not fetch the latest.  I traced this back to the setting of udev into package.mask due to concerns over incompatibility with kernel and udev versions and various other kernel requirements.  All of those have since been worked out, but udev remained in package.mask unintentionally.  I have removed it and portage now wants to update udev, so thanks for pointing us in that direction.  I think you and turtles are right in that the issue is that udev was removed from sysinit, but here's an interesting side notion.  We have a mail and web server which run the same software (they are mirror copies, but each only runs certain software most of the time to provide a backup in case of hardware failure).  The mail server also had udev masked and the same baselayout/openrc situation, but the network starts just fine on it.  I checked and sure enough udev is listed in sysinit on that server.  So something strange happened regarding udev on the web server that did not affect the mail server, but it seems that fixing sysinit will take care of the problem.  I still plan to travel to the server and do this on-location, just to be sure, but I am not very confident that this is what needs to be done.

@turtles

Thanks also for your reply.  We do actually have a testing server in the office that we run these type of upgrades and developments on, and we never experienced this specific problem.  As mentioned above, we have a mail and a web server, and the mail server upgraded based on the executed steps and plan without any trouble, something must have went awry with the web server implementation.  Thanks again for confirming that the resolution should be adding udev to sysinit (we will also do the udev upgrades and set the kernel config suggested).

Thanks guys, I will mark this as SOLVED once I return from the collocation facility and all is well.

----------

## dageyra

Network now starts properly, thanks guys.

----------

## guid0

Sorry for reopening a solved post. I just completed a fresh install on a new box and im hitting the exact same issue: Network interface scripts start fine from the commandline but not on boot.

```
ifconfig -a
```

perfectly shows eth0/eth1/eth2/eth3 (i have /etc/udev/rules.d/80-net-name-slot.rules in place)

```
rc-update show sysinit
```

shows devfs, dmesg, sysfs, tmpfiles.dev, udev and udev-mount

```
rc-update show default
```

shows net.eth0,1,2 and 3 amongst other things

```
zcat /proc/config.gz | grep DEVTMPFS
```

lists both CONFIG_DEVTMPFS=y and CONFIG_DEVTMPFS_MOUNT=y

yet i dont get any active ethX devices on boot  :Sad: 

```
udevd --version
```

208

Anyone kind enough to point me into the right direction?

tnx,

guid0

----------

## guid0

fixed   :Embarassed: 

vanilla rc.conf does not enable hotplugging by default. i tried rc_hotplug="YES" but that seems to have been old syntax.

```
rc_hotplug="*"

rc_coldplug="*"
```

seems to have fixed my problem  :Smile: 

----------

