# Gentoo boots to fast, network related services don't start

## Kasumi_Ninja

Every time I boot nfsmount and ntp-client fails because my network isn't running yet.  I searched the forums and found a fix, however since the fix is 2 years old I wonder if things have changed in between. Is this the best way to solve this problem? Are there other solutions? Will it eventually be solved?

```
/etc/conf.d/rc

RC_NET_STRICT_CHECKING="yes"

rc-update add net.eth0 boot
```

Edit:

Will the parallel boot option help?

----------

## NeddySeagoon

Aniruddha,

Thats not a fix its a dirty hack that will haunt you.

It doesn't really start eth0 in the boot runlevel, it forces eth0 and everything that eth0 depends on into to boot runlevel as well.

Do you have the auto or defualts options set for your nfs mount in /etc/fstab ?

If so you need something like

```
# An NFS mount to see whats on Eccles without logging in

# eccles:/home          /mnt/eccles     nfs     bg,_netdev,rsize=8192,wsize=8192
```

----------

## Kasumi_Ninja

Hi Ned,

Thanks for the help! I have the following options in fstab for nfs:

```
user,rw,async
```

However this doesn't explain why ntp-client doesn't run   :Rolling Eyes:  Maybe it's time to fill a bugreport?

----------

## NeddySeagoon

Aniruddha,

The boot sequence tries to mount your nfs with local file systems and cant because the network is not up when it tries.

bg,_netdev, tells mount to background this mount if it fails and that its a network device.

Once the network is up, the mount will complete

----------

## Kasumi_Ninja

Thanks for the tip, is there such a solution available for ntp-client as well?

----------

## demarc

ntp-client should automatically start when net.eth0 eventually comes up. Are you just receiving the error message or is ntp-client stopped/inactive after your perform an 'rc-status' ?

----------

## NeddySeagoon

Aniruddha,

ntp-clent should depend on networking. Exactly what that means depends on how you have set 

```
rc_depend_strict=
```

in rc.conf.

If you have more than one network interface in the default runlevel, setting ="NO" means that dependent services can start when the first interface comes up. That can make ntp-client fail, if the first interface up does not provide your internet connecion.

Setting ="YES" means all the defined network interfaces must be started ... this means that your internet connection should be there too.

However, on a laptop where you may use one, another, or all interfaces in different combinations you need to set  code]rc_depend_strict="NO"[/code]and ensure your network interfaces are started in the right order.

Putting net.eth0 in the boot runlevel normally means that net.lo will be up first, and you will never find a ntp server on lo, so ntp-client is bound to fail.

----------

## Kasumi_Ninja

 *NeddySeagoon wrote:*   

> Aniruddha,
> 
> The boot sequence tries to mount your nfs with local file systems and cant because the network is not up when it tries.
> 
> bg,_netdev, tells mount to background this mount if it fails and that its a network device.
> ...

 

This is my new fstab, unfortunately nfsmount still fails   :Sad: 

```
#nfs

192.168.1.111:/mnt/mount1       /mnt/mount1     nfs     bg,_netdev,user,rw,async   0 0

192.168.1.112:/mnt/mount2       /mnt/mount2    nfs     bg,_netdev,user,rw,async   0 0

192.168.1.1113/mnt/mount3      /mnt/mount3      nfs     bg,_netdev,user,rw,async   0 0
```

@demarc

The ntp-client service is service is running, but because it updates only once (during boot) this means the time doesn't get adjusted.

----------

## Kasumi_Ninja

 *NeddySeagoon wrote:*   

> Aniruddha,
> 
> ntp-clent should depend on networking. Exactly what that means depends on how you have set 
> 
> ```
> ...

 

Do you mean I have to set the RC_NET_STRICT_CHECKING option in /etc/conf.d/rc  to yes? I can't find such setting in /etc/rc.conf.

/etc/conf.d/rc

```
# RC_NET_STRICT_CHECKING allows some flexibility with the 'net' service.

# The following values are allowed:

#  none  - The 'net' service is always considered up.

#  no    - This basically means that at least one net.* service besides net.lo

#          must be up.  This can be used by notebook users that have a wifi and

#          a static nic, and only wants one up at any given time to have the

#          'net' service seen as up.

#  lo    - This is the same as the 'no' option, but net.lo is also counted.

#          This should be useful to people that do not care about any specific

#          interface being up at boot.

#  yes   - For this ALL network interfaces MUST be up for the 'net' service to

#          be considered up.

RC_NET_STRICT_CHECKING="no"
```

/etc/rc.conf

```
# cat /etc/rc.conf  

# /etc/rc.conf: Global startup script configuration settings

# UNICODE specifies whether you want to have UNICODE support in the console.  

# If you set to yes, please make sure to set a UNICODE aware CONSOLEFONT and 

# KEYMAP in the /etc/conf.d/consolefont and /etc/conf.d/keymaps config files.

UNICODE="yes"

# Set EDITOR to your preferred editor.

# You may use something other than what is listed here.

EDITOR="/bin/nano"

#EDITOR="/usr/bin/vim"

#EDITOR="/usr/bin/emacs"

# DISPLAYMANAGER has moved to /etc/conf.d/xdm

# XSESSION is a new variable to control what window manager to start

# default with X if run with xdm, startx or xinit.  The default behavior

# is to look in /etc/X11/Sessions/ and run the script in matching the

# value that XSESSION is set to.  The support scripts are smart enough to

# look in all bin directories if it cant find a match in /etc/X11/Sessions/,

# so setting it to "enlightenment" can also work.  This is basically used

# as a way for the system admin to configure a default system wide WM,

# allthough it will work if the user export XSESSION in his .bash_profile, etc.

#

# NOTE:  1) this behaviour is overridden when a ~/.xinitrc exists, and startx

#           is called.

#        2) even if ~/.xsession exists, if XSESSION can be resolved, it will

#           be executed rather than ~/.xsession, else KDM breaks ...

#

# Defaults depending on what you install currently include:

#

# Gnome - will start gnome-session

# kde-<version> - will start startkde (look in /etc/X11/Sessions/)

# Xfce4 - will start a XFCE4 session

# Xsession - will start a terminal and a few other nice apps

XSESSION="Gnome"
```

----------

## NeddySeagoon

Aniruddha,

My paste was from baselayout2 with OpenRC. baselayout1 has a different control file layout and I don't have baselayout1 any more.

However, that setting is there somewhere.

----------

## Kasumi_Ninja

 *NeddySeagoon wrote:*   

> Aniruddha,
> 
> My paste was from baselayout2 with OpenRC. baselayout1 has a different control file layout and I don't have baselayout1 any more.
> 
> However, that setting is there somewhere.

 

I changed the settings in /etc/conf.d/rc, unfortunately this didn't help   :Crying or Very sad:  I guess I have to install baselayout 2 then

```
# RC_NET_STRICT_CHECKING allows some flexibility with the 'net' service.

# The following values are allowed:

#  none  - The 'net' service is always considered up.

#  no    - This basically means that at least one net.* service besides net.lo

#          must be up.  This can be used by notebook users that have a wifi and

#          a static nic, and only wants one up at any given time to have the

#          'net' service seen as up.

#  lo    - This is the same as the 'no' option, but net.lo is also counted.

#          This should be useful to people that do not care about any specific

#          interface being up at boot.

#  yes   - For this ALL network interfaces MUST be up for the 'net' service to

#          be considered up.

RC_NET_STRICT_CHECKING="yes"
```

----------

## Kasumi_Ninja

I do have baselayout2 (installation was a breeze) and the recommended settings, unfortunately both ntp-client as nfsmount still timeout   :Confused: 

rc.conf

```
 # cat /etc/rc.conf 

# Global OpenRC configuration settings

# Set to "YES" if you want the rc system to try and start services

# in parallel for a slight speed improvement. When running in parallel we

# prefix the service output with it's name as the output will get

# jumbled up.

rc_parallel="NO"

# 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"
```

fstab

```
#nfs

192.168.1.111:/mnt/mount1       /mnt/mount1     nfs     bg,_netdev,user,rw,async   0 0

192.168.1.112:/mnt/mount2       /mnt/mount2    nfs     bg,_netdev,user,rw,async   0 0

192.168.1.1113/mnt/mount3      /mnt/mount3      nfs     bg,_netdev,user,rw,async   0 0
```

Update:

Here's the log from rc:

```
# cat /var/log/rc.log 

rc boot logging started at Tue Aug  5 02:48:53 2008

 * Setting system clock using the hardware clock [Local Time] ...

select() to /dev/rtc to wait for clock tick timed out

 * Failed to set the system clock

 [ !! ]

 * Loading module vboxdrv ...

 [ ok ]

 * Autoloaded 1 module(s)

 * Checking local filesystems  ...

/dev/disk/by-id/scsi-SATA_SAMSUNG_part2: clean, 

/dev/disk/by-id/scsi-SATA_SAMSUNG_part3: clean, 

/dev/disk/by-id/scsi-SATA_SAMSUNG_part4: clean, 

/dev/disk/by-id/scsi-SATA_SAMSUNG_-part1: clean

 [ ok ]

 * Remounting root filesystem read/write ...

 [ ok ]

 * Updating /etc/mtab ...

 [ ok ]

 * Mounting local filesystems ...

 [ ok ]

 * Setting hostname to Zenpc ...

 [ ok ]

 * Configuring kernel parameters ...

 [ ok ]

 * Creating user login records ...

 [ ok ]

 * Cleaning /var/run ...

 [ ok ]

 * Wiping /tmp directory ...

 [ ok ]

 * Loading ALSA modules ...

 *   Loading: snd-card-0 ...

 [ ok ]

 *   Loading: snd-pcm-oss ...

 [ ok ]

 *   Loading: snd-seq-oss ...

 [ ok ]

 [ ok ]

 * Restoring Mixer Levels ...

 [ ok ]

 * Setting terminal encoding [UTF-8] ...

 [ ok ]

 * Setting console font [default8x16] ...

 [ ok ]

 * Loading key mappings [us] ...

 [ ok ]

 * Setting keyboard mode [UTF-8] ...

 [ ok ]

 * Bringing up interface lo

 *   127.0.0.1/8 ...

 [ ok ]

 *   Adding routes

 *     127.0.0.0/8 via 127.0.0.1 ...

 [ ok ]

 * Bringing up interface eth0

 *   dhcp ...

 *     Running dhcpcd ...

 [ ok ]

 *     received address 192.168.1.111/24

 [ ok ]

 * Mounting USB device filesystem [usbfs] ...

 [ ok ]

 * Mounting nfsd filesystem ...

 [ ok ]

 * Activating swap devices ...

 [ ok ]

 * Initializing random number generator ...

 [ ok ]

rc boot logging stopped at Tue Aug  5 02:49:05 2008

rc default logging started at Tue Aug  5 02:49:05 2008

 * Starting D-BUS system messagebus ...

 [ ok ]

 * Starting dhcdbd ...

 [ ok ]

 * Starting syslog-ng ...

 [ ok ]

 * Starting Hardware Abstraction Layer daemon ...

 [ ok ]

 * Starting NetworkManager ...

 [ ok ]

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

Error : Temporary failure in name resolution

 * Failed to set clock

 [ !! ]

 * ERROR: ntp-client failed to start

 * Starting portmap ...

 [ ok ]

 * Starting NFS statd ...

 [ ok ]

 * Starting avahi-daemon ...

 [ ok ]

 * Starting NFS sm-notify ...

Backgrounding to notify hosts...

 [ ok ]

 * Mounting NFS filesystems ...

 [ !! ]

 * ERROR: nfsmount failed to start

 * Mounting network filesystems ...

 * Could not mount all network filesystems

 [ !! ]

 * Starting gpm ...

 [ ok ]

 * Setting up gdm ...

 [ ok ]

 * Starting avahi-dnsconfd ...

 [ ok ]

 * Starting cupsd ...

 [ ok ]

 * Starting S.M.A.R.T. monitoring daemon ...

 [ ok ]

 * Starting vixie-cron ...

 [ ok ]

 * Starting local ...

 [ ok ]

rc default logging stopped at Tue Aug  5 02:49:45 2008
```

----------

## NeddySeagoon

Aniruddha,

```
 * Setting system clock using the hardware clock [Local Time] ...

select() to /dev/rtc to wait for clock tick timed out

 * Failed to set the system clock 
```

Do you have a /dev/rtc ?

The kernel config changed in this area around 2.6.24 and it was off by default.

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

Error : Temporary failure in name resolution

 * Failed to set clock 
```

DHCP has either failed, returned you a link-local address or not set up a nameserver in /etc/resolv.conf.

Your services could also be in a mess. What does

```
rc-update --verbose
```

show?

----------

## Kasumi_Ninja

Hi Ned,

First things first; enabling the rc_parallel fixed this problem. Now the nfs partitions get mounted and the network time gets synchronized, I don't have a clue why this works though.

```
rc_parallel="YES"
```

I do have a /dev/rtc. Here's the output of rc-update --verbose:

```
              dmcrypt |                              

      mit-krb5kadmind |                              

             wesnothd |                              

           consolekit |                              

                 ntpd |                              

        device-mapper |        boot                  

              keymaps |        boot                  

                 nscd |                              

                 mtab |        boot                  

                 hald |                       default

            pydoc-2.5 |                              

         avahi-daemon |                       default

               smartd |                       default

              numlock |                              

            bacula-fd |                              

            bacula-sd |                              

           ntp-client |                       default

               hdparm |                              

          mit-krb5kdc |                              

            syslog-ng |                       default

           vixie-cron |                       default

             keytouch |                              

           portagexsd |                              

                mysql |                              

           git-daemon |                              

         mysqlmanager |                              

                local |             nonetwork default

                 dbus |                       default

             hellanzb |                              

          consolefont |        boot                  

             dhcrelay |                              

               twistd |                              

             net.eth0 |                       default

                 swap |        boot                  

       udev-postmount |                              

           fancontrol |                              

              urandom |        boot                  

             rpc.gssd |                              

               sysctl |        boot                  

         termencoding |        boot                  

           lm_sensors |                              

          rpc.svcgssd |                              

               net.lo |        boot                  

                 fsck |        boot                  

            syndaemon |                              

                 slpd |                              

               procfs |        boot                  

            pe-format |                              

                  nfs |                              

             nfsmount |                       default

             bootmisc |        boot                  

               xinetd |                              

           atieventsd |                              

             hostname |        boot                  

                  xdm |                       default

            saslauthd |                              

              usermin |                              

            rpc.statd |                              

           localmount |        boot                  

                 fuse |                              

              apache2 |                              

       NetworkManager |                       default

                spamd |                              

               serial |                              

             dmeventd |                              

             netmount |                       default

            bluetooth |                              

              portmap |                              

                 irda |                              

               esound |                              

               dhcdbd |                              

                 sshd |                              

          crypto-loop |                              

              hwclock |        boot                  

            alsasound |        boot                  

              pwcheck |                              

           bacula-dir |                              

              modules |        boot                  

        pg_autovacuum |                              

                dhcpd |                              

                  gpm |                       default

                samba |                              

                cupsd |                       default

           rpc.idmapd |                              

               xprint |                              

               webmin |                              

                acpid |                              

               rsyncd |                              

           postgresql |                              

               hsqldb |                              

       avahi-dnsconfd |                       default

                 root |        boot         
```

----------

## NeddySeagoon

Aniruddha,

That all looks good. I like alsasound in default rather than boot but I'm paranoid about things not needed for boot preventing booting.

As  rc_parallel="YES" fixed it, I guess you have found a race condition, which would indicate that the dependancies in the /etc/conf.d/* files you use are not specified properly.

Time to file a bug.

----------

## Kasumi_Ninja

 *NeddySeagoon wrote:*   

> Aniruddha,
> 
> That all looks good. I like alsasound in default rather than boot but I'm paranoid about things not needed for boot preventing booting.
> 
> As  rc_parallel="YES" fixed it, I guess you have found a race condition, which would indicate that the dependancies in the /etc/conf.d/* files you use are not specified properly.
> ...

 

Ok, thanks for the help I'll file a bugreport. Btw I'm switching back to the previous baselayout since I've had to many problems (no tty terminals, ati 3s acceleration isn't working anymore).

----------

