# OpenRC and net.eth0 does not work?!

## DingbatCA

I am feeling a bit dumb on this one.  I can not seem to get net.eth0 to start on one of my systems, it never loads.

```

INIT: Entering runlevel: 3

 * Starting syslog-ng ... [ ok ]

 * Setting clock via the NTP client 'ntpdate' ...

Exiting, name server cannot be used: Temporary failure in name resolution (-3) * Failed to set clock [ !! ]

 * ERROR: ntp-client failed to start

 * Starting rpcbind ... [ ok ]

 * Starting NFS statd ... [ ok ]

 * Starting NFS sm-notify ... [ ok ]

 * Mounting NFS filesystems ...

mount.nfs: Failed to resolve server 192.168.0.2: Name or service not known [ !! ]

 * ERROR: nfsmount failed to start

 * Mounting network filesystems ...

mount.nfs: Failed to resolve server 192.168.0.2: Name or service not known [ ok ]

 * Starting snmpd ... [ ok ]

 * Starting sshd ... [ ok ]

 * Starting local

```

So lets go thought the basics:

```

xenspark init.d # pwd

/etc/init.d

xenspark init.d # ls -la net.eth0

lrwxrwxrwx 1 root root 6 May 18 14:28 net.eth0 -> net.lo

xenspark init.d # rc-update -s | grep net.eth0

             net.eth0 |           default

xenspark init.d # /etc/init.d/net.eth0 start

 * Bringing up interface eth0

 *   192.168.0.98 ...

 [ ok ]

 *   Adding routes

 *     default via 192.168.0.1 ...

 [ ok ]

xenspark init.d # cat /etc/conf.d/net

config_eth0="192.168.0.98 netmask 255.255.255.0 broadcast 192.168.0.255"

routes_eth0="default via 192.168.0.1"

xenspark init.d # ls /etc/runlevels/default/

local     netmount  ntp-client  sshd       udev-postmount

net.eth0  nfsmount  snmpd       syslog-ng

xenspark init.d # ls -la /etc/runlevels/default/net.eth0

lrwxrwxrwx 1 root root 20 May 18 14:04 /etc/runlevels/default/net.eth0 -> /etc/init.d/net.eth0

xenspark init.d # emerge -s openrc

Searching...

[ Results for search key : openrc ]

[ Applications found : 1 ]

*  sys-apps/openrc

      Latest version available: 0.8.2-r1

      Latest version installed: 0.8.2-r1

      Size of files: 157 kB

      Homepage:      http://www.gentoo.org/proj/en/base/openrc/

      Description:   OpenRC manages the services, startup and shutdown of a host

      License:       BSD-2

xenspark init.d # echo WTF!

WTF!

```

What am I missing?!

----------

## dmpogo

Sticking to basics, what does ifconfig show after startup ?   From you original output it is not clear that net.eth0 did not start, perhaps interface did not get an IP ?

----------

## rigor

When I did my openRC updates last week, I saw that net.lo was in the boot runlevel. I did the same for net.eth0.

You could try that.

```
rc-update del net.eth0 default

rc-update add net.eth0 boot

```

hth,

Rigor

----------

## Anon-E-moose

 *rigor wrote:*   

> When I did my openRC updates last week, I saw that net.lo was in the boot runlevel. I did the same for net.eth0.
> 
> You could try that.
> 
> ```
> ...

 

net.lo should be in boot

net.<anything else> should be in default

----------

## shur

This is a similar but different problem. After an update, I find that my /etc/init.d/net.eth0 has simply disappeared.

Can someone please let me know how I can get it back? Thank you, I will be very grateful.

----------

## Apheus

 *shur wrote:*   

> This is a similar but different problem. After an update, I find that my /etc/init.d/net.eth0 has simply disappeared.
> 
> Can someone please let me know how I can get it back? Thank you, I will be very grateful.

 

http://www.gentoo.org/doc/en/openrc-migration.xml#doc_chap2_pre9

----------

## DingbatCA

```

xenspark ~ # uptime

 00:01:23 up 1 min,  1 user,  load average: 0.00, 0.00, 0.00

xenspark ~ # ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:16:3e:49:4d:d2

          BROADCAST MULTICAST  MTU:1500  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

tunl0     Link encap:IPIP Tunnel  HWaddr

          NOARP  MTU:1480  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

xenspark ~ # ifconfig

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

xenspark ~ # rc-update del net.eth0

 * service net.eth0 removed from runlevel default

xenspark ~ # rc-update del net.lo boot

 * service net.lo removed from runlevel boot

xenspark ~ # rc-update add net.lo boot

 * service net.lo added to runlevel boot

xenspark ~ # rc-update add net.eth0 default

 * service net.eth0 added to runlevel default

xenspark ~ # rc-update -s

                 udev |                               sysinit

       udev-postmount |           default

                 sshd |           default

             bootmisc |                          boot

            syslog-ng |           default

                snmpd |           default

             nfsmount |           default

                  lvm |                          boot

        device-mapper |                          boot

           ntp-client |           default

                 fsck |                          boot

             hostname |                          boot

                local | nonetwork default

           localmount |                          boot

             netmount |           default

                 root |                          boot

            savecache |                                       shutdown

                 swap |                          boot

               sysctl |                          boot

              urandom |                          boot

                devfs |                               sysinit

                dmesg |                               sysinit

              hwclock |                          boot

          consolefont |                          boot

              keymaps |                          boot

            killprocs |                                       shutdown

              modules |                          boot

             mount-ro |                                       shutdown

                 mtab |                          boot

               procfs |                          boot

         termencoding |                          boot

               net.lo |                          boot

             net.eth0 |           default

```

net.lo loads as part of boot.  If I add net.eth0 to boot, it does not load. Still no luck.  Ideas?

----------

## shur

many thanks. Of course I should keep up on changes.

----------

## Anon-E-moose

what does "lspci -k" return

----------

## DingbatCA

```

xenspark ~ # lspci -k

xenspark ~ #

xenspark ~ # cat /etc/rc.conf | grep rc_sys

rc_sys="xenU"

```

lspci returns nothing.  Xenspark is a VM domU under xen.

----------

## Anon-E-moose

 *DingbatCA wrote:*   

> 
> 
> ```
> 
> xenspark ~ # lspci -k
> ...

 

That would have been a helpful thing to know in the 1st place.

Are your network drivers compiled into the kernel or loaded as modules?

----------

## DingbatCA

All net drivers are compiled into the kernel.

I don't see how being a VM changes this problem.  The network card is there, and working. The VM was working fine until the OpenRC upgrade. Manual start of net.eth0 works just fine.  I am not sure how to debug openrc.

----------

## DNAspark99

I too, had net.eth0 failing to start on boot after the openRC/baselayout upgrade.

Could start it _manually_ and it would come up without issue, but I could not get it to come up 'on it's own', despite all indications that it should be working.

May not be the ideal solution, but setting the following in /etc/rc.conf got it to start at boot:

```

rc_depend_strict="YES"

```

----------

## DingbatCA

```

 * Bringing up interface eth0

 *   192.168.0.98 ...  [ ok ]

 *   Adding routes

 *     default via 192.168.0.1 ... [ ok ]

```

Thanks DNAspark99!  Setting rc_depend_strict="YES" in my rc.conf worked!

----------

## sr66

 *DNAspark99 wrote:*   

> I too, had net.eth0 failing to start on boot after the openRC/baselayout upgrade.
> 
> Could start it _manually_ and it would come up without issue, but I could not get it to come up 'on it's own', despite all indications that it should be working.
> 
> May not be the ideal solution, but setting the following in /etc/rc.conf got it to start at boot:
> ...

 

Thanks DNAspark99.  That worked for me too.

I also had to do the following (which has been discussed elsewhere in the http://www.gentoo.org/doc/en/openrc-migration.xml and above)

```

cd /etc/init.d

ln -s net.lo net.eth0

rc-update add net.eth0 default

```

----------

## Psi15

worked for me as well - but I'm wondering why the system even has the option of not starting something that is in the default runlevel...

----------

## SStreet

I just stumbled upon a solution.   I just built a new system from the minimal install ISO dated 20110708.  After getting the basic system installed and booting off its own HDD,  I found that nothing I had added to that default startup group would start.

Seems that warning for datetime being correct should be heeded more closely.  After 15 minutes of head troubleshooting, I realized that the clock on the system during the time of the chroot build process was hours ahead of real time,  I set the time with the date command and didn't give it another thought.  That was until I realized after wondering why in the world none of my services where starting.  In trying to debug the startup, I found the datetime stamps on some of files in the future - that's when it hit me.

To fix my issue and get everthing to startup.   

rc-update --update

This forcing a dependency tree update and finally resolved my startup issues.

----------

## jlpoole

My SheevaPlug (headless) suffers this problem:  on reboot, the dhcpcd fails to secure its IP, and then, of course, other services such as sshd and apache fail because there is no network connection.  I'm effectively blocked from accessing the computer until I establish a hard-wire link.   Yet, when I am able to log in via my serial port (using minicom from another computer), I can then start dhcpcd and then sshd.  This suggests that there is a priority issue afoot at startup time and that dhcpcd is being called too early.  

I have not brought my system up current as of today, but will do so just to see if the dhcpcd updates.  I did activate 

```
rc_depend_strict="YES" 
```

in /etc/rc.conf and I also performed "rc-update --update", these two solutions did not solve my problem.

I'll update when I fix the problem and learn why.

----------

## FizzyWidget

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

look under network, about halfway down

----------

## jlpoole

 *Dark Foo wrote:*   

> http://www.gentoo.org/doc/en/openrc-migration.xml
> 
> look under network, about halfway down

 

Thank you -- I found the problem: I had the old style and somehow had missed the distinction of not having parenthesis when I reviewed the openrc-migration.xml weeks, if not months, earlier.  Here's the revised file that works:

```
plug init.d # 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 :]!).

#

# Below is old style

# per http://www.gentoo.org/doc/en/openrc-migration.xml

#

#config_eth0=( "dhcp" )

config_eth0="dhcp"

plug init.d #

```

----------

