# "Shutting down lo..." pause and stall on shutdown [solved]

## CptPajamas

I have several Shuttle ST62K Pentium 4 machines running Gentoo 2006.0, NIS enabled. Upon trying to shut them down, I encounter a long, long delay right after eth0 shuts off when it's trying to shut down lo. It does eventually shut down (or reboot), it just takes anywhere from 5-10 minutes.

Does anyone have any ideas?

It's not a portmap user-related error, as there is a local rpc user. However, I am open to suggestions regarding the nsswitch.conf (passwd being nis,files) and any explanation how that could be the cause of this delay.

Ideas?

----------

## UberLord

You probably have nis before files in nsswitch.conf

----------

## CptPajamas

EDIT: Post removed.

----------

## zephred

Hello,

 *UberLord wrote:*   

> You probably have nis before files in nsswitch.conf

 

I have the same problem, having nis before files in nsswitch.conf (on purpose). What does this hanging has to do with nsswitch.conf ? I have older version of gentoo on other machines, with the same config, and no hanging.

Thanks for any help,

Fred.

PS: at boot, it takes 2minutes to go past the start of portmap. Is it related ? I guess there is something here I really do not get...   :Confused: 

----------

## UberLord

 *zephred wrote:*   

> Hello,
> 
>  *UberLord wrote:*   You probably have nis before files in nsswitch.conf 
> 
> I have the same problem, having nis before files in nsswitch.conf (on purpose). What does this hanging has to do with nsswitch.conf ? I have older version of gentoo on other machines, with the same config, and no hanging.

 

Older versions of baselayout did not bring down the lo interface as requested - newer versions do.

BTW, it is not good to have NIS before files and here is why. NIS is not available when the system boots, so any udev lookups will goto nis first and may hang.

Even when using NIS/LDAP systems, it's very advisable to have all system users (root, adm, disk, etc) in /etc/passwd and always have files first.

 *Quote:*   

> PS: at boot, it takes 2minutes to go past the start of portmap. Is it related ? I guess there is something here I really do not get...  

 

Possibly. portmap has a sleep in it's init script that we should be able to remove once baselayout-1.12.4 or newer goes stable. Try the new baselayout - it may solve a lot of your issues.

----------

## zephred

 *UberLord wrote:*   

> BTW, it is not good to have NIS before files and here is why. NIS is not available when the system boots, so any udev lookups will goto nis first and may hang.
> 
> Even when using NIS/LDAP systems, it's very advisable to have all system users (root, adm, disk, etc) in /etc/passwd and always have files first.

 

OK, I switched nis and files in nsswitch.conf, as, anyway, I do not have any good reason anymore to do this.

 *UberLord wrote:*   

> Possibly. portmap has a sleep in it's init script that we should be able to remove once baselayout-1.12.4 or newer goes stable. Try the new baselayout - it may solve a lot of your issues.

 

I have upgraded to baselayout-1.12.4, and those 2 problems are gone !  :Smile: 

But there is quite a big problem with this version: there is no more domainname startup files (conf.d and init.d), so that ypbind and autofs cannot start. I guess there will very soon be a 1.12.5 !  :Wink: 

Thanks again for your quick answer !

Fred.

----------

## UberLord

 *zephred wrote:*   

> But there is quite a big problem with this version: there is no more domainname startup files (conf.d and init.d), so that ypbind and autofs cannot start. I guess there will very soon be a 1.12.5 ! 

 

No there won't be - the domainname script is no longer relevant. To set the domain name's, do this in /etc/conf.d/net

dns_domain_lo="foo.bar.com"

nis_domain_lo="nissy"

We've moved to this model so we can easily support > 1 interface having dns information, which makes the domainname script redundant. If ypbind and autofs depend on the old script like so

```

depend() {

    need domainname

}

```

need could also be use, after and before.

If you see that in an init script, please report it as a bug to bugs.gentoo.org

Thanks

----------

## zephred

 *UberLord wrote:*   

> No there won't be - the domainname script is no longer relevant. To set the domain name's, do this in /etc/conf.d/net

 

OK, Sorry I did not notice the message at the end of emerge... But I am quite puzzled by the proposed options in net.example. There can be several domainname (one for each network interface) for one machine ?! I do not see any way to do that in domainame's manpage. In your example:

```
dns_domain_lo="foo.bar.com"

nis_domain_lo="nissy"
```

you set domain names for lo !! It puzzles me even more...

How are those values used with standard commands (domainame, nisdomainame, ypdomainname...) ? Maybe this could be mentionned in net.example, or in some man page. I would have needed this to guess how to do a 

```
route add -host 239.2.11.71 dev eth1
```

 in /etc/conf.d/net. I had to dig in the source code to reach 

```
e=$( ip route append dev ${iface} ${x} 2>&1 )
```

 and to guess I had to add 

```
routes_eth1=( " -host 239.2.11.71" )
```

.

For a lot of those new variables in /etc/conf.d/net.example, I do not understand, from their name only, the full extend of their use.

 *UberLord wrote:*   

> If you see that in an init script, please report it as a bug to bugs.gentoo.org

 

Done. Dependencies in ypserv-2.19.

Thanks for your help !

Fred.

----------

## UberLord

 *zephred wrote:*   

> OK, Sorry I did not notice the message at the end of emerge... But I am quite puzzled by the proposed options in net.example. There can be several domainname (one for each network interface) for one machine ?! I do not see any way to do that in domainame's manpage. In your example:
> 
> ```
> dns_domain_lo="foo.bar.com"
> 
> ...

 

OK, get your head around this one.

The machine yes, can only have ONE dns domain.

But what happens when you have >1 interface using dhcp and they want the box to be different dns domains?

dns_domain_lo="laptop.home"

dns_domain_vpn="work.com"

Now add resolvconf-gentoo into the mix and you get fine grained control.

 *Quote:*   

> 
> 
> How are those values used with standard commands (domainame, nisdomainame, ypdomainname...) ? Maybe this could be mentionned in net.example, or in some man page.

 

Look in /lib/rcscripts/net/system.sh for the gory details if you like.

The bit in net.example you missed starts on line 630

----------

## zephred

 *UberLord wrote:*   

> OK, get your head around this one.
> 
> The machine yes, can only have ONE dns domain.
> 
> But what happens when you have >1 interface using dhcp and they want the box to be different dns domains?
> ...

 

OK, I actually missed the line 638 "If you omit the _eth0 suffix, then it applies to all interfaces", so I know now how to write my config. 

For my eth1 interface (both eth0 and eth1 are up), which is on dhcp, I use dhcpcd_eth1="-N -Y -R -G" to keep the values set as static. What should I write to have the same behaviour with the *_eth* variables ? Set every *_eth1 to "" ?

After reading /lib/rcscripts/net/system.sh, I understand ntp.conf will be overwritten only if any ntp_servers_NIC is defined, right ?

I am still wondering what happens if domainname has different values for eth0 and eth1, and that both NICs are up.

Sorry to bother you for those questions, but I really think this parts needs more documentation.

PS: the message about the changes with domainname after emerging -u baselayout appears before the list of files unmerged... so, invisible. I should systematically use portlog-info -s 1h !

----------

