Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

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

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
16 posts • Page 1 of 1
Author
Message
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

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

  • Quote

Post by Kasumi_Ninja » Thu Jul 31, 2008 7:34 pm

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?

Code: Select all

/etc/conf.d/rc
RC_NET_STRICT_CHECKING="yes"
rc-update add net.eth0 boot
Edit:
Will the parallel boot option help?
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Jul 31, 2008 8:21 pm

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

Code: Select all

# An NFS mount to see whats on Eccles without logging in
# eccles:/home          /mnt/eccles     nfs     bg,_netdev,rsize=8192,wsize=8192
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Thu Jul 31, 2008 8:35 pm

Hi Ned,

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

Code: Select all

user,rw,async
However this doesn't explain why ntp-client doesn't run :roll: Maybe it's time to fill a bugreport?
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Jul 31, 2008 8:54 pm

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
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Thu Jul 31, 2008 9:13 pm

Thanks for the tip, is there such a solution available for ntp-client as well?
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
demarc
n00b
n00b
Posts: 2
Joined: Fri Aug 01, 2008 1:03 am

  • Quote

Post by demarc » Fri Aug 01, 2008 1:08 am

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' ?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Fri Aug 01, 2008 3:10 pm

Aniruddha,

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

Code: Select all

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.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Mon Aug 04, 2008 12:16 pm

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.

Once the network is up, the mount will complete
This is my new fstab, unfortunately nfsmount still fails :(

Code: Select all

#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.
Last edited by Kasumi_Ninja on Mon Aug 04, 2008 12:32 pm, edited 1 time in total.
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Mon Aug 04, 2008 12:30 pm

NeddySeagoon wrote:Aniruddha,

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

Code: Select all

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.

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

Code: Select all

# 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

Code: Select all

# 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"
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Mon Aug 04, 2008 5:10 pm

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.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Mon Aug 04, 2008 10:14 pm

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 :cry: I guess I have to install baselayout 2 then

Code: Select all

# 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"
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Mon Aug 04, 2008 10:45 pm

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

rc.conf

Code: Select all

 # 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

Code: Select all

#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:

Code: Select all

# 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
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Aug 05, 2008 5:20 pm

Aniruddha,

Code: Select all

 * 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.

Code: Select all

 * 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

Code: Select all

rc-update --verbose
show?
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Tue Aug 05, 2008 5:50 pm

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.

Code: Select all

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

Code: Select all

              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         
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Aug 05, 2008 7:38 pm

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.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Kasumi_Ninja
Veteran
Veteran
User avatar
Posts: 1825
Joined: Sat Feb 18, 2006 7:22 am
Location: The Netherlands

  • Quote

Post by Kasumi_Ninja » Tue Aug 05, 2008 7:43 pm

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.

Time to file a bug.
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).
Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
Top
Post Reply

16 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic