Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
net.eth0 does not start at boot [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
dageyra
Apprentice
Apprentice


Joined: 22 Feb 2005
Posts: 194
Location: Terre Haute, IN

PostPosted: Sat May 12, 2012 8:32 pm    Post subject: net.eth0 does not start at boot [SOLVED] Reply with quote

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
Code:

 # /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
Code:

 # lsmod
Module                  Size  Used by


net.eth0 is listed to start at default
Code:

# 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
Code:

# 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:
Code:

 # 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
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1353

PostPosted: Sun May 13, 2012 11:28 pm    Post subject: Reply with quote

What version of udev are you running?
Do you have
Code:
grep 'CONFIG_DEVTMPFS' /usr/src/linux/.config

enabled?

EDIT.
Check also udev runlevel:
Code:
 ls -l /etc/runlevels/sysinit
[/quote]
_________________
Donate to Gentoo
Back to top
View user's profile Send private message
dageyra
Apprentice
Apprentice


Joined: 22 Feb 2005
Posts: 194
Location: Terre Haute, IN

PostPosted: Mon May 14, 2012 1:57 am    Post subject: Reply with quote

turtles wrote:
What version of udev are you running?
Do you have
Code:
grep 'CONFIG_DEVTMPFS' /usr/src/linux/.config

enabled?

EDIT.
Check also udev runlevel:
Code:
 ls -l /etc/runlevels/sysinit


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

Code:

# grep 'CONFIG_DEVTMPFS' /usr/src/linux/.config
# CONFIG_DEVTMPFS is not set


Concerning udev:

Code:

# 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:
Code:

# 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.
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Mon May 14, 2012 3:32 am    Post subject: Reply with quote

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

Code:
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 :!:
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
turtles
Veteran
Veteran


Joined: 31 Dec 2004
Posts: 1353

PostPosted: Mon May 14, 2012 5:14 pm    Post subject: Reply with quote

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
Code:
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.
Code:
rc-update add udev sysinit

_________________
Donate to Gentoo
Back to top
View user's profile Send private message
dageyra
Apprentice
Apprentice


Joined: 22 Feb 2005
Posts: 194
Location: Terre Haute, IN

PostPosted: Tue May 15, 2012 12:35 am    Post subject: Reply with quote

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

Code:
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 :!:


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.
Back to top
View user's profile Send private message
dageyra
Apprentice
Apprentice


Joined: 22 Feb 2005
Posts: 194
Location: Terre Haute, IN

PostPosted: Thu May 31, 2012 12:16 pm    Post subject: Reply with quote

Network now starts properly, thanks guys.
Back to top
View user's profile Send private message
guid0
Guru
Guru


Joined: 06 Jul 2003
Posts: 321
Location: The Netherlands / Nederland

PostPosted: Sat Feb 15, 2014 4:20 pm    Post subject: Reply with quote

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.

Code:
ifconfig -a


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

Code:
rc-update show sysinit


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

Code:
rc-update show default


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

Code:
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 :(

Code:
udevd --version

208

Anyone kind enough to point me into the right direction?

tnx,
guid0
Back to top
View user's profile Send private message
guid0
Guru
Guru


Joined: 06 Jul 2003
Posts: 321
Location: The Netherlands / Nederland

PostPosted: Sat Feb 15, 2014 4:37 pm    Post subject: Reply with quote

fixed :oops:

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

Code:
rc_hotplug="*"
rc_coldplug="*"


seems to have fixed my problem :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum