# emerge -DuN world now gives me init script error [RESOLVED]

## The Gimp

I'm hoping this is an easy fix.

I'm a Gentoo newbie and having now spent the best part of the past two weeks learning (the hard way) about USE flags and portage I've now come to yet another error with my install that I have no idea how to fix.

I recently changed some USE flags in /etc/make.conf and decided to emerge -DuN world overnight.  That turned into 24 hours on my measly 1GHz VIA Nehemiah CPU and, after reboot, I'm getting the following error as the init scripts are executing:

```
* Starting D-Bus system messagebus ...

Unknown username "named" in message bus configuration file

* Starting eth0

*    Bringing up eth0

*       dhcp

*          Running dhcpcd ...

parseDhcpMsgRecv: 6 options received:

i=1   len=4   option = 255.255.255.0

i=3   len=4   option = 192.168.0.1 

i=6   len=4   option = 192.168.0.1

i=51  len=4   option = 259200

i=51  len=1   option = 5

i=51  len=4   option = 192.168.0.1

DhcpMsgRecv->yiaddr  = 192.168.0.4

DhcpMsgRecv->siaddr  = 0.0.0.0

DhcpMsgRecv->giaddr  = 0.0.0.0

DhcpMsgRecv->sname   = ""

ServerHardwareAddr   = 00.18.4D.3C.DC.E2
```

Why am I getting this?  How do I fix it?

----------

## madisonicus

You're doing great.  Soon this will be old hat.  Just think of how much you've already learned!   :Wink: 

The dhcp stuff is probably coming from how you have your /etc/conf.d/net file set up.  Please post it.

-m

----------

## The Gimp

**he reaches for a LiveCD**

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

dns_domain_lo="homenetwork"

config_eth0=("dhcp")

dhcp_eth0=("nodns nontp nonis")
```

Is this normal?

----------

## The Gimp

Bump.

----------

## The Gimp

Problem after problem: as a n00b I'm used to it but Gentoo is really beginning to wear me down.

I've been at it now for 3 weeks trying to customise my Gentoo install.  I've made mistakes with USE flags and - after several hours of recompiling   :Sad:  - corrected them.

But this is the latest.  I posted it 2 days ago and had 1 hit.  I've exhausted that.  I've read up on init scripts and tried to follow the /etc/init.d/net.eth0 file to see if I can make out where it's going wrong.  But I'm not a developer and I didn't get very far.  

I've tried searching the forums but without luck.

In a last desperate attempt to get this resolved, I've double posted into this forum.  Apologies to the mods for this but I am at a dead end.  I cannot go any further.  My resistance is at a new low.  Gentoo has almost broken me.  This is a last ditch attempt to get some help.  Please could someone give me some guidance on how I can fix things?  I'm sure it's easy, but I just don't know what to do.   :Crying or Very sad: 

----------

## Jaglover

First, after you re-emerged your stuff - did you update your configuraton files?

Second, in case this is a desktop DHCP is really not needed, I prefer to use static configuration whenever I can.

If you absolutely must use DHCP follow usual routine for diagnosing problems. Meaning you should run dhcpcd from command line to see if it works and what's wrong. Once you get your problems sorted then it's time to put your options into conf file - /etc/conf.d/net file in this case.

----------

## wynn

 *The Gimp wrote:*   

> **he reaches for a LiveCD**
> 
> ```
> # This blank configuration will automatically use DHCP for any net.*
> 
> ...

 I don't think that is going to work as you have 'dns_domain_lo="homenetwork"', which will empty your /etc/resolv.conf and then 'nodns' in your setting for 'dhcp_eth0' which will mean that dhcp won't put a nameserver in it.

You're probably better off with

```
config_eth0=("dhcp")

dhcp_eth0=("nontp nonis")
```

The "nontp" assumes that you have your own, manually configured, /etc/ntp.conf: is this true?

The additional output from dhcp in your original post just looks as if you have debug enabled. It's not important at the moment, get networking going and then you can polish things if you wish.

Setting up your own domain name is probably better done by *Quote:*   

> Set your host and domain name
> 
> Set your host name in /etc/conf.d/hostname and /etc/hosts. In the following example, we use mybox as host name and at.myplace as domain name. You can either edit the config files with nano or use the following commands:
> 
> Code Listing 2.18: Set host and domain name
> ...

 from Gentoo Linux x86 Quick Install Guide

----------

## NeddySeagoon

The Gimp,

You have got the network script running in verbose mode, its showing you the setup you have been offered, which looks sane. What do you get in 

```
route -n 
```

You have dhcp_eth0=("nodns nontp nonis") in your /etc/init.d/net, which means that dchpcd will not set up your dns server address. Thats not wrong, you need to set it in /etc/resolv.conf yourself.

dhcpcd JustWorks if the /etc/conf.d/net file is empty, so rename yours and test.

----------

## timeBandit

Go look at your original post again, you've received a number of helpful replies in the last ten minutes.

EDIT: Ignore this post, it was in reply to a duplicate thread that has been merged here.

----------

## Quantum_C

Are you using the IRC for help? If not you are missing out on a lot of free and easy help  :Razz: 

----------

## beandog

 *Quantum_C wrote:*   

> Are you using the IRC for help? If not you are missing out on a lot of free and easy help 

 

Agreed.  Also, if you dont know what you're doing, don't touch the use flags.  At all.  The defaults will work great for a desktop system.  If you need to change stuff, add some only.

And use dispatch-conf instead of etc-update (always sound advice), and use RCS to help you keep track of changes (emerge rcs, man rcs, update dispatch-conf.conf to use-rcs=yes).

----------

## The Gimp

Thank you all for your replies.

I've read them but still can't get it working.

However, I have discovered how to use the Interactive Boot Mode (pressing "I" during the init scripts) so now I can control things a bit more and get to login!

@Jaglover:

No, I didn't update my configuration files after emerging.  How do I do that and should I do it ASAP?

@wynn:

Thanks for the info.  You've now explained to me why I kept on having to manually put 'nameserver 192.168.0.1' into my /etc/resolv.conf every so often.  I'd always wondered what was causing it.

@NeddySeagoon:

Thanks - once again  :Wink:  - 'route -n' gives me:

```
gentoo ~ # route -n

Kernel IP routing table

Destination     Gateway    Genmask    Flags    Metric   Ref   Use   Iface

127.0.0.0      0.0.0.0      255.0.0.0    U          0         0      0       lo
```

Of course, I haven't started /etc/init.d/net.eth0 as I stopped that during the Interactive Boot Mode.  

I've run

```
rc-update del net.eth0 default

rc-update add net.eth0 default

/etc/init.d/net.eth0 start
```

but I still get the same errors as per my original post.  What can I do?

----------

## NeddySeagoon

The Gimp,

Now you can log in, start networkign manually with 

```
/etc/init.d/net.eth0 start
```

What do you have in 

```
route -n
```

What is in /etc/resolv.conf

Does 

```
ping google.com
```

work?

What about 

```
ping 72.14.207.99
```

Your original post does not show any errors, just verbose messages.

----------

## The Gimp

 *NeddySeagoon wrote:*   

> Now you can log in, start networking manually with 
> 
> ```
> /etc/init.d/net.eth0 start
> ```
> ...

 Done.  It just keeps hanging after the verbose messages.  I opened another terminal and ran 'route -n'.  It gives:

```
gentoo ~ # route -n

Kernel IP routing table

Destination     Gateway    Genmask    Flags    Metric   Ref   Use   Iface

192.168.0.0   0.0.0.0          255.255.255.0   U          0        0      0       eth0

127.0.0.0      0.0.0.0          255.0.0.0          U          0         0      0       lo

0.0.0.0          192.168.0.1   0.0.0.0             UG        0         0      0      eth0
```

 *Quote:*   

> What is in /etc/resolv.conf

 

Just one line - 'domain homenetwork'

 *Quote:*   

> Does 
> 
> ```
> ping google.com
> ```
> ...

 

No.  "ping: unknown host google.com"

 *Quote:*   

> What about 
> 
> ```
> ping 72.14.207.99
> ```
> ...

 

I think so.  I get lots of lines like "64 bytes from 72.14.2007.99: icmp_seq=76 ttl=241 time=97.7ms"

 *Quote:*   

> Your original post does not show any errors, just verbose messages.

 Thanks for the clarification.

----------

## The Gimp

P.S. I'm having problems with nano.  I was trying to add 'nameserver 192.168.0.1' to /etc/resolv.conf but as soon as I try to move the cursor with the arrow keys, all this random looking text comes over the terminal screen making it impossible to read.  I had to

```
echo "nameserver 192.168.0.1" >> /etc/resolv.conf
```

 to edit it.  Any ideas why my arrow keys are producing verbose text output?  I did notice this straight after I emerge -DuN world 2 days ago.

----------

## NeddySeagoon

The Gimp,

You probably have the wrong keyboard set up for the console, or you have UTF-8 turned om but are using a console font that does not support it.

Type the nameserver line as the first line. The order of the entries in config files is rarely important but there are a few odd exceptions.

----------

## The Gimp

Thanks NeddySeagoon, but my console (terminal??) font is Monospace 10 and I've been using it without any problems prior to the (now infamous) emerge -DuN world.  It's very annoying as I only know how to use nano and I quite like it for text editing.

P.S.  I'm going to bed now as I've got work tomorrow.  Thx for your help and any more clues you can give me on my nano problem would be appreciated.  Should I re-emerge nano?

----------

## NeddySeagoon

The Gimp,

Read the top of /etc/rc.conf and check the /etc/conf.d/consolefont and /etc/conf.d/keymaps files are correct.

Its possible you accepted an update in etc-config you should have declined or vice versa.

Do you have an etc-update outstanding from your emerge -DuN ?

Don't blindly accept all or reject all - look at each one and determine if you need it   or not.

----------

## The Gimp

The only uncommented lines in /etc/rc.conf are:

```
UNICODE="yes"

EDITOR="/bin/nano"
```

The only uncommented line in /etc/conf.d/consolefont is:

```
CONSOLEFONT="default8x16"
```

/etc/conf.d/keymaps shows only:

```
KEYMAP="us"

SET_WINDOWKEYS="no"

EXTENDED_KEYMAPS=""

DUMPKEYS_CHARSET=""
```

I'll have to change the 'us' to 'uk' but should I change anything else?  My keyboard is a Cherry CyMotion Master Linux (uk qwerty with additional keypad and cherry/linux keys - which I haven't programmed yet).  I've specified it as Generic 105-key (Intl) PC in 'Keyboard model' in Gnome's Keyboard Preferences with the 'Layout' as United Kingdom.

How can I tell if I have an outstanding etc-update?

If I have one, how to I fix it/update?

----------

## wynn

/etc/rc.conf is the same here; /etc/conf.d/consolefont is

```
CONSOLEFONT="lat9v-16"
```

to get a Unicode aware font; /etc/conf.d/keymaps is

```
KEYMAP="uk"

SET_WINDOWKEYS="yes"

EXTENDED_KEYMAPS=""

DUMPKEYS_CHARSET="iso-10646-18"
```

SET_WINDOWKEYS=yes because I now (kicking and screaming...  :Smile:  ) have a keyboard with the Windows keys on. If you are interested, I can post on how to get various Unicode characters to appear by using LWINL (Left Windows Logo) or RWINL (Right Windows Logo) as modifiers avoiding the use of Alt Gr which the window manager might be using. DUMPKEYS_CHARSET for Unicode as well.

To see if there are any outstanding config updates just run "etc-update", if it says nothing, there aren't. You might like to look at dispatch-conf which does the same thing but saves old config files so you can recover if you made a mistake.

----------

## The Gimp

I am at work now  :Sad:  but when I get home I will modify my /etc/conf.d/consolefont and /etc/conf.d/keymaps to be identical to yours.

I will also run etc-update as you suggest.

Thank you for your helpful explanations.

**he goes away to google 'unicode characters' as he's a n00b and as NFI what 'unicode characters' are, lol**

----------

## wynn

 *The Gimp wrote:*   

> **he goes away to google 'unicode characters' as he's a n00b and as NFI what 'unicode characters' are, lol**

 Markus Kuhn's FAQ is very good: UTF-8 and Unicode FAQ for Unix/Linux â â (Unicode emdash and leftarrow   :Smile:  ) but Googling you may find something more to your taste.

----------

## The Gimp

I updated /etc/conf.d/consolefont and also /etc/conf.d/keymaps as I said I would but it didn't seem to fix it.

I have 'debug' as one of my USE variables in /etc/make.conf and I thought this was the cause.

I ran

```
emerge --unmerge nano
```

and then I ran

```
USE="-debug" emerge nano
```

and it seems to have fixed it.  I can now edit in nano without any problems.   :Smile:   The first thing I did is take 'debug' out of my USE variables!

My concern, however, is that way back when I ran 'emerge - DuN world' 'debug' was still a USE variable.  Would this be the reason why I'm seeing the net.eth0 text (my very first post on this thread)?  If so, how do I get rid of it?

----------

## timeBandit

 *The Gimp wrote:*   

> My concern, however, is that way back when I ran 'emerge - DuN world' 'debug' was still a USE variable.  Would this be the reason why I'm seeing the net.eth0 text (my very first post on this thread)?  If so, how do I get rid of it?

 

After you've removed debug from your USE flags in make.conf:

```
emerge --oneshot --ask --newuse --verbose sys-apps/baselayout
```

after which you'll probably want to run revdep-rebuild. If you haven't already emerged gentoolkit, which provides revdep-rebuild, do so before reinstalling baselayout (just in case something really weird happens).

If you can spare the time and want to get rid of all unnecessary effects of the debug flag, do this:

```
emerge -aN system

emerge -aN world
```

----------

## The Gimp

OK.  I've done what you suggested (apart from the emerge -aN stuff) but I'm still getting

```
 * Starting eth0

 *   Bringing up eth0

 *     dhcp

 *       Running dhcpcd ...

parseDhcpMsgRecv: 6 options received:

i=1   len=4   option = 255.255.255.0

i=3   len=4   option = 192.168.0.1

i=6   len=4   option = 192.168.0.1

i=51  len=4   option = 259200

i=53  len=1   option = 5

i=54  len=4   option = 192.168.0.1

DhcpMsgRecv->yiaddr  = 192.168.0.4

DhcpMsgRecv->siaddr  = 0.0.0.0

DhcpMsgRecv->giaddr  = 0.0.0.0

DhcpMsgRecv->sname   = ""

ServerHardwareAddr   = 00.18.4D.3C.DC.E2
```

Which is damn annoying.  I think there's no choice but to emerge -DuN world again   :Crying or Very sad:   :Crying or Very sad:   :Crying or Very sad: 

Looking on the bright side, I've learnt quite a bit about the init scripts and networking (but the thought of emerging world again AAAAAAAAAGH)

***EDIT***

Now emerging -aN system

----------

## timeBandit

I apologize: I didn't read carefully your earlier posts and made a mistake.  :Embarassed: 

You mentioned the net.eth0 script produces the extraneous output, so I suggested re-merging baselayout (which provides /etc/init.d/net.eth0) to correct it. But net.eth0 is just a script, and I see in your transcript that the messages relate to DHCP setup, and actually seem to have originated from dhcpcd.

When emerge system completes, try emerge -a1N net-misc/dhcpcd (that's a numeral one, not letter ell) next before rebuilding the whole world. Unless something outside of dhcpcd produces those messages without identifying itself first, that should cure your noise from net.eth0.   :Smile: 

----------

## The Gimp

np timeBandit, i ran 'emerge -a1N net-misc/dhcpcd' and it did fix it.  Thx v.much.

----------

## timeBandit

Glad to hear it. If that's the last of your troubles on this topic, please add [SOLVED] to the subject of your original post.

----------

## The Gimp

Done.  Once again to everyone who answered the call: thx v. much!

----------

