# eth0 network problems

## multix

Hi,

I experience that my ethernet card doesn't come up well. It is statically configured, it looks OK in ifconfig (IP address configured) but I cannot even ping a local machine, the network is down.

If I do

/etc/init.d/net.eth0 stop

/etc/init.d/net.eth0 start

then it works perfectly.

During startup, I notice that there are some warnings about certain configuration files, how can I read them to report them here? they scroll away too fast to read them and perhaps they are useful.

Riccardo

----------

## wswartzendruber

Can you mash <ScrLk> while the machine boots?  Oh and I'd like to see ifconfig's output from both boot and "/etc/init.d/net.eth0 restart"

----------

## bigbangnet

What you wanna check is your dmesg. It will tell you whats the errors on startup with you got no time to look at. It should be in your /var/log folder. Use nano, vi or some other editor to take a look and copy it here

----------

## wcg

There is a dmesg command as well as the /var/log/dmesg file.

```

dmesg|less

# or

less /var/log/dmesg

```

Opening the /var/log/dmesg file with a text editor will allow you

to copy just the part of dmesg that seems relevant to another

file for posting.

To save the messages from the net.eth0 restart to a file to compare

them with the boot messages:

```

/etc/init.d/net.eth0 stop

(/etc/init.d/net.eth0 start) 2>&1 | tee /tmp/eth0_restart

```

You will see the messages on your console and they will

be written to the file /tmp/eth0_restart.

----------

## multix

Hmm... I checked dmesg already before posting: it contains kernel messages but not script outputs.

However the scroll-lock trick works.

I get:

```
/etc/init.d/udev: line 119: /rdun/udev/rules.d/90-network.rules: No such file or directory

```

Repeated 3 times

further down it says that the network script is deprecated and will be removed in the future.

perhaps the migration to openRc did not go go well? I think I followed http://www.gentoo.org/doc/en/openrc-migration.xml decently

----------

## ultraincognito

 *multix wrote:*   

> I get:
> 
> ```
> /etc/init.d/udev: line 119: /rdun/udev/rules.d/90-network.rules: No such file or directory
> ```
> ...

 

'rdun'? I think there must be 'etc' instead.

----------

## multix

Sorry, I mistyped, the error message is:

```

/etc/init.d/udev: line 119: /run/udev/rules.d/90-network.rules: No such file or directory

```

----------

## ultraincognito

Do you have /run directory in your system?

----------

## apgf

 *ultraincognito wrote:*   

> Do you have /run directory in your system?

 

same problem with line 119, also line 120 and 121 after

```
[ebuild     U  ] sys-fs/udev-171-r5 [164-r2] USE="acl%* -action_modeswitch% -build -debug% edd%* extras -floppy% gudev%* hwdb%* -introspection% keymap%* rule_generator%* (-selinux) -test" 601 kB
```

/run/udev exists, but there is no file 90-network.rules, but there is one in /lib64/udev/rules.d/

```

# /etc/init.d/udev

start_pre()

local f="$(get_rundir)/rules.d/90-network.rules"

get_rundir()

{

  echo $(udevadm info --run)

}

```

```

udevadm info --run

/run/udev

ls /run/udev/rules.d/90-network.rules

not found

locate 90-network.rules

/lib64/udev/rules.d/90-network.rules

ls -al /lib64/udev/rules.d/90-network.rules 

-rw-r--r-- 1 root root 280 13. Feb 20:43 /lib64/udev/rules.d/90-network.rules

/etc/rc.conf

rc_hotplug="*"

```

----------

## Gusar

The /run stuff isn't about having a /run/udev directory and that's it. It's about having /run and mounting a tmpfs on it veeeery early in the boot process, pretty much at the same time as /proc and /sys get mounted. Other parts of the init system may need to be adjusted for /run as well.

However, this is not necessarily the cause of your issue. Could be, but could also be something else.

----------

## apgf

 *Gusar wrote:*   

> The /run stuff isn't about having a /run/udev directory and that's it. It's about having /run and mounting a tmpfs on it veeeery early in the boot process, pretty much at the same time as /proc and /sys get mounted. Other parts of the init system may need to be adjusted for /run as well.
> 
> However, this is not necessarily the cause of your issue. Could be, but could also be something else.

 

thanx for your fast response. 

in my case there is a /run/udev/ directory and i didn't create it

and in /etc/init.d/udev i have

```
get_rundir()

{

  echo $(udevadm info --run)

}

```

where i get

```
udevadm info --run

/run/udev

```

what should i do?

----------

## Gusar

It seems Gentoo is already prepared for /run, as the first two lines OpenRC prints at boot are "Mounting /proc" and "Mounting /run". Must have happened when I wasn't looking  :Smile: . Do you have a /var/run directory, or is it a symlink to /run?

In any case, no idea why udev would be looking for the network file in /run. I don't have it there, and udev is fine with that, the network comes up at boot without issues.

----------

## apgf

 *Gusar wrote:*   

> It seems Gentoo is already prepared for /run, as the first two lines OpenRC prints at boot are "Mounting /proc" and "Mounting /run". Must have happened when I wasn't looking . Do you have a /var/run directory, or is it a symlink to /run?
> 
> In any case, no idea why udev would be looking for the network file in /run. I don't have it there, and udev is fine with that, the network comes up at boot without issues.

 

```
ls -lad /var/run/

drwxr-xr-x 38 root root 4096 15. Feb 12:52 /var/run/
```

```
eix ^udev$

[I] sys-fs/udev

     Available versions:  114 115-r1 119 124-r1 124-r2 141{tbz2} ~141-r1 146-r1!t 149 151-r4 164-r2 171-r5 [M]~175-r1 [M]~180 [M]~181 **9999!u {acl action_modeswitch build debug (+)devfs-compat doc edd (-)extras floppy gudev hwdb introspection keymap old-hd-rules +rule_generator selinux static-libs test zlib}

     Installed versions:  171-r5(20:43:11 13.02.2012)(acl edd extras gudev hwdb keymap rule_generator -action_modeswitch -build -debug -floppy -introspection -selinux -test)

     Homepage:            http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html

     Description:         Linux dynamic and persistent device naming support (aka userspace devfs)

```

which version of udev do you have?

whats returns

```
udevadm info --run
```

on your system?

----------

## ese002

I  think the solution is to simply remove /etc/init.d/network from the boot process.

Until this morning, I was having what appears to be the identical problem, with two wrinkles:

1) I run pure 32-bit.

2) 90-network.rules does not exist at all

I discovered that if I restarted /etc/init.d/network rather than /etc/init.d/net.eth0, my default route was not fixed.  The script said it was adding the route but it didn't actually do it.  This matched what happened at boot time.

I removed network from the boot process and rebooted.  This time, the route messages came up but they could only have come from net.eth0 and my default route was set.  

What I think is going on is two things:

1) Execution of /etc/init.d/network is broken.  This is likely a consequence of being no longer maintained.

2) net.eth0, which is maintained, will not run fully in the boot process if /etc/init.d./network has already started.  rc--status reports that it has a started so it is not as simple as saying net.eth0 does not run.

----------

## apgf

 *ese002 wrote:*   

> I  think the solution is to simply remove /etc/init.d/network from the boot process.

 

thank you for the answer, I will try it tomorow

----------

## apgf

 *ese002 wrote:*   

> I  think the solution is to simply remove /etc/init.d/network from the boot process.

 

great, it works. thanx a lot.

Do I have to mark this as solved? When yes, how do I do that?

----------

## ese002

Convention is that the user who created the thread changes the subject of the first message to start with [Solved]. Are you the same person as multix?

----------

## apgf

 *ese002 wrote:*   

> Convention is that the user who created the thread changes the subject of the first message to start with [Solved]. Are you the same person as multix?

 

no. thats why i could not change it.

----------

