Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
"Failed to set clock" at boot time
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Sat Feb 20, 2010 11:52 am    Post subject: "Failed to set clock" at boot time Reply with quote

I'm getting the following error at boot time:
Code:
"Setting the clock via the ntp client 'ntpdate' ...
Failed to set clock"

The log file looks like this:
Code:
# grep ntp /var/log/messages
Feb 20 11:48:26 gentoo ntpdate[4882]: no servers can be used, exiting

My wireless connection is started before ntp-client with wicd, but maybe the connection isn't established before the ntp client tries to set the clock.
Code:
# rc-update show
           alsasound | boot
             apache2 |      default
            bootmisc | boot
             checkfs | boot
           checkroot | boot
               clock | boot
         consolefont | boot
               cupsd |      default
                dbus |      default
          fbcondecor | boot
                hald |      default
            hostname | boot
             keymaps | boot
               local |      default nonetwork
          localmount | boot
             modules | boot
               mysql |      default
         mythbackend |      default
              net.lo | boot
            netmount |      default
          ntp-client |      default
           rmnologin | boot
              serial | boot
                sshd |      default
           syslog-ng |      default
             urandom | boot
          vixie-cron |      default
                wicd | boot
                 xdm |      default
              xinetd |      default

ntp is configured like this:
Code:
# cat /etc/ntp.conf                                         
# NOTES:                                                                   
# DHCP clients can append or replace NTP configuration files.             
# You should consult your DHCP client documentation about its             
# default behaviour and how to change it.                                 

# Name of the servers ntpd should sync with
# Please respect the access policy as stated by the responsible person.
#server         ntp.example.tld         iburst                         

# Common pool for random people
#server pool.ntp.org           

# Pools for Gentoo users
server 0.gentoo.pool.ntp.org iburst
server 1.gentoo.pool.ntp.org iburst
server 2.gentoo.pool.ntp.org iburst
server 3.gentoo.pool.ntp.org iburst

##
# A list of available servers can be found here:
# http://www.pool.ntp.org/
# http://www.pool.ntp.org/#use
# A good way to get servers for your machine is:
# netselect -s 3 pool.ntp.org
##

# you should not need to modify the following paths
driftfile       /var/lib/ntp/ntp.drift

#server ntplocal.example.com prefer
#server timeserver.example.org

# Warning: Using default NTP settings will leave your NTP
# server accessible to all hosts on the Internet.

# If you want to deny all machines (including your own)
# from accessing the NTP server, uncomment:
#restrict default ignore


# To deny other machines from changing the
# configuration but allow localhost:
restrict default nomodify nopeer
restrict 127.0.0.1


# To allow machines within your network to synchronize
# their clocks with your server, but ensure they are
# not allowed to configure the server or used as peers
# to synchronize against, uncomment this line.
#
#restrict 192.168.0.0 mask 255.255.255.0 nomodify nopeer notrap

And /etc/init.d/ntp-client is adjusted in the following way:
Code:
depend() {
        before cron portmap
#       need net
        after net.wlan0 || after net.eth0
        use dns logger
}

After login ntp-client works fine:
Code:
# /etc/init.d/ntp-client start
 * Setting clock via the NTP client 'ntpdate' ...                                                                      [ ok ]

From my point of view it seems like the wireless connection isn't established in time during boot and ntp-client runs into timeout. How could I change the timeout setting of ntp-client?


Last edited by samo on Sat Feb 20, 2010 6:18 pm; edited 1 time in total
Back to top
View user's profile Send private message
grooveman
Veteran
Veteran


Joined: 24 Feb 2003
Posts: 1217

PostPosted: Sat Feb 20, 2010 5:45 pm    Post subject: Reply with quote

This is a bit of a hack, but you you could simply disable ntp at boot, and try putting something like: "ntpdate tick.usno.navy.mil" in /etc/conf.d/local.start. Local should run last, so if wicd is starting, it should work...
_________________
To look without without looking within is like looking without without looking at all.
Back to top
View user's profile Send private message
billium
Apprentice
Apprentice


Joined: 22 Mar 2003
Posts: 185

PostPosted: Mon Feb 22, 2010 8:27 pm    Post subject: Reply with quote

It may be because there is too big a time difference between your rtc and ntp server.

int /etc/conf.d/ntpd you can use the -s option to set the time immediately
Code:
NTPD_OPTS="-s"


billy
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Mon Feb 22, 2010 9:16 pm    Post subject: Reply with quote

Code:
NTPD_OPTS="-s"

Doesn't help. When I start ntp-client manually at console I get the following output
Code:
Feb 22 22:14:32 gentoo ntpdate[5532]: step time server 64.73.32.135 offset -0.316384 sec
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 550
Location: Venice FL

PostPosted: Wed Feb 24, 2010 5:55 pm    Post subject: Reply with quote

Interesting, I have the same problem, different reason, and it seems to me that it should just work, and not require a hack around to get ntp-client to run.... maybe a bug?

in my rc.log, this shows that it runs at the proper time, but fails because it claims the DNS is not available.
Code:
* Allowing Internet access ...
 [ ok ]
 [ ok ]
 * Setting clock via the NTP client 'ntpdate' ...
Name server cannot be used, exiting * Failed to set clock
 [ !! ]
 * ERROR: ntp-client failed to start


and the relevant part of /etc/conf.d/ntp-client
Code:
NTPCLIENT_OPTS="-s -b -u us.pool.ntp.org"


Anyone come across this before?

George
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Wed Feb 24, 2010 6:12 pm    Post subject: Reply with quote

How can I get the rc.log?
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 550
Location: Venice FL

PostPosted: Wed Feb 24, 2010 7:21 pm    Post subject: Reply with quote

samo wrote:
How can I get the rc.log?


for me it is in /etc/rc.conf

I'm using openrc (baselayout2 I believe)

look for:
Code:
# /var/log/rc.log
# NOTE: Linux systems require the devfs service to be started before
# logging can take place and as such cannot log the sysinit runlevel.
rc_logger="YES"


Set to YES, the default is NO.

the log will be /var/log/rc.log

George
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3920
Location: Hamburg

PostPosted: Wed Feb 24, 2010 8:03 pm    Post subject: Reply with quote

You're sure that your network is up and running and provides valid DNS responses when ntp is starting ?
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Wed Feb 24, 2010 8:43 pm    Post subject: Reply with quote

It seems like the connection is established too late. I get the following error in /var/log/messages.
Code:
Feb 24 21:32:11 gentoo ntpdate[3574]: no servers can be used, exiting
But at that time, the connection isn't established as I can see in /var/log/wicd/wicd.log
Code:
2010/02/24 21:32:01 :: ---------------------------                                                     
2010/02/24 21:32:01 :: wicd initializing...                                                           
2010/02/24 21:32:01 :: ---------------------------                                                     
2010/02/24 21:32:01 :: wicd is version 1.6.2.2 463                                                     
2010/02/24 21:32:01 :: setting backend to external                                                     
2010/02/24 21:32:01 :: trying to load backend external                                                 
2010/02/24 21:32:01 :: successfully loaded backend external                                           
2010/02/24 21:32:01 :: WARNING: No path found for udhcpc                                               
2010/02/24 21:32:01 :: WARNING: No path found for gksudo                                               
2010/02/24 21:32:01 :: WARNING: No path found for resolvconf                                           
2010/02/24 21:32:01 :: trying to load backend external                                                 
2010/02/24 21:32:01 :: successfully loaded backend external                                           
2010/02/24 21:32:01 :: WARNING: No path found for udhcpc                                               
2010/02/24 21:32:01 :: WARNING: No path found for gksudo                                               
2010/02/24 21:32:01 :: WARNING: No path found for resolvconf                                           
2010/02/24 21:32:01 :: Couldn't detect a wireless interface.                                           
2010/02/24 21:32:01 :: setting wireless interface wlan0                                               
2010/02/24 21:32:01 :: automatically detected wired interface eth1                                     
2010/02/24 21:32:01 :: setting wired interface eth0                                                   
2010/02/24 21:32:01 :: setting wpa driver wext                                                         
2010/02/24 21:32:01 :: setting use global dns to True                                                 
2010/02/24 21:32:01 :: setting global dns                                                             
2010/02/24 21:32:01 :: global dns servers are 208.67.222.222 None None                                 
2010/02/24 21:32:01 :: domain is None                                                                 
2010/02/24 21:32:01 :: search domain is None                                                           
2010/02/24 21:32:01 :: setting automatically reconnect when connection drops True                     
2010/02/24 21:32:01 :: found wired_connect_mode in configuration 1                                     
2010/02/24 21:32:01 :: Setting dhcp client to 2                                                       
2010/02/24 21:32:01 :: Wireless configuration file found...                                           
2010/02/24 21:32:01 :: Wired configuration file found...                                               
2010/02/24 21:32:01 :: chmoding configuration files 0600...                                           
2010/02/24 21:32:01 :: chowning configuration files root:root...                                       
2010/02/24 21:32:01 :: Using wireless interface...wlan0                                               
2010/02/24 21:32:01 :: Using wired interface...eth0                                                   
2010/02/24 21:32:01 :: scanning start                                                                 
2010/02/24 21:32:01 :: ifconfig wlan0 up                                                               
2010/02/24 21:32:02 :: iwlist wlan0 scan                                                               
2010/02/24 21:32:06 :: hidden                                                                         
2010/02/24 21:32:06 :: scanning done                                                                   
2010/02/24 21:32:06 :: found 4 networks:                                                               
2010/02/24 21:32:06 :: found afterscript in configuration None                                         
2010/02/24 21:32:06 :: found psk in configuration 3256da0781fb12ce15f680a13cb9225744ae7618dd3b33d4ec4c1497cb8e9601                                                                                           
2010/02/24 21:32:06 :: found postdisconnectscript in configuration None                               
2010/02/24 21:32:06 :: found netmask in configuration 255.255.255.0                                   
2010/02/24 21:32:06 :: found key in configuration 'password'                                         
2010/02/24 21:32:06 :: found predisconnectscript in configuration None                                 
2010/02/24 21:32:06 :: found gateway in configuration 192.168.178.1                                   
2010/02/24 21:32:06 :: found use_global_dns in configuration 1                                         
2010/02/24 21:32:06 :: found disconnect in configuration None                                         
2010/02/24 21:32:06 :: found use_settings_globally in configuration 0                                 
2010/02/24 21:32:06 :: found use_static_dns in configuration 1                                         
2010/02/24 21:32:06 :: found ip in configuration 192.168.178.22                                       
2010/02/24 21:32:06 :: found beforescript in configuration None                                       
2010/02/24 21:32:06 :: found enctype in configuration wpa                                             
2010/02/24 21:32:06 :: found automatic in configuration True                                           
2010/02/24 21:32:06 :: found essid in configuration Gentoo                                             
2010/02/24 21:32:07 :: ifconfig eth0                                                                   
2010/02/24 21:32:07 :: ifconfig wlan0                                                                 
2010/02/24 21:32:07 :: iwconfig wlan0                                                                 
2010/02/24 21:32:07 :: GetCurrentNetworkID: Returning -1, current network not found                   
2010/02/24 21:32:07 :: Autoconnecting...                                                               
2010/02/24 21:32:07 :: ifconfig eth0 up                                                               
2010/02/24 21:32:09 :: Starting wireless autoconnect...                                               
2010/02/24 21:32:09 :: No wired connection present, attempting to autoconnect to wireless network     
2010/02/24 21:32:09 :: scanning start                                                                 
2010/02/24 21:32:09 :: ifconfig wlan0 up                                                               
2010/02/24 21:32:09 :: iwlist wlan0 scan                                                               
2010/02/24 21:32:12 :: hidden                                                                         
2010/02/24 21:32:13 :: scanning done                                                                   
2010/02/24 21:32:13 :: found 6 networks:                                                               
2010/02/24 21:32:13 :: found afterscript in configuration None                                         
2010/02/24 21:32:13 :: found psk in configuration 3256da0781fb12ce15f680a13cb9225744ae7618dd3b33d4ec4c1497cb8e9601                                                                                           
2010/02/24 21:32:13 :: found postdisconnectscript in configuration None                               
2010/02/24 21:32:13 :: found netmask in configuration 255.255.255.0                                   
2010/02/24 21:32:13 :: found key in configuration 'password'                                         
2010/02/24 21:32:13 :: found predisconnectscript in configuration None                                 
2010/02/24 21:32:13 :: found gateway in configuration 192.168.178.1                                   
2010/02/24 21:32:13 :: found use_global_dns in configuration 1                                         
2010/02/24 21:32:13 :: found disconnect in configuration None                                         
2010/02/24 21:32:13 :: found use_settings_globally in configuration 0                                 
2010/02/24 21:32:13 :: found use_static_dns in configuration 1                                         
2010/02/24 21:32:13 :: found ip in configuration 192.168.178.22                                       
2010/02/24 21:32:13 :: found beforescript in configuration None                                       
2010/02/24 21:32:13 :: found enctype in configuration wpa                                             
2010/02/24 21:32:13 :: found automatic in configuration True                                           
2010/02/24 21:32:13 :: found essid in configuration Gentoo                                             
2010/02/24 21:32:13 :: Gentoo has profile                                                             
2010/02/24 21:32:13 :: trying to automatically connect to...Gentoo                                     
2010/02/24 21:32:13 :: Connecting to wireless network Gentoo                                           
2010/02/24 21:32:13 :: /sbin/dhcpcd -k eth0                                                           
2010/02/24 21:32:13 :: ifconfig eth0 0.0.0.0                                                           
2010/02/24 21:32:13 :: /sbin/ip route flush dev eth0                                                   
2010/02/24 21:32:13 :: ifconfig eth0 down                                                             
2010/02/24 21:32:13 :: ifconfig eth0 up                                                               
2010/02/24 21:32:13 :: Putting interface down                                                         
2010/02/24 21:32:13 :: ifconfig wlan0 down                                                             
2010/02/24 21:32:13 :: Releasing DHCP leases...                                                       
2010/02/24 21:32:13 :: /sbin/dhcpcd -k wlan0                                                           
2010/02/24 21:32:13 :: Setting false IP...                                                             
2010/02/24 21:32:13 :: ifconfig wlan0 0.0.0.0                                                         
2010/02/24 21:32:14 :: iwconfig wlan0                                                                 
2010/02/24 21:32:14 :: Stopping wpa_supplicant                                                         
2010/02/24 21:32:14 :: wpa_cli -i wlan0 terminate                                                     
2010/02/24 21:32:14 :: Flushing the routing table...                                                   
2010/02/24 21:32:14 :: /sbin/ip route flush dev wlan0                                                 
2010/02/24 21:32:14 :: iwconfig wlan0 mode managed                                                     
2010/02/24 21:32:14 :: Putting interface up...                                                         
2010/02/24 21:32:14 :: ifconfig wlan0 up                                                               
2010/02/24 21:32:14 :: enctype is wpa                                                                 
2010/02/24 21:32:14 :: Generating psk...                                                               
2010/02/24 21:32:14 :: ['/usr/bin/wpa_passphrase', 'Gentoo', 'password']                           
2010/02/24 21:32:14 :: Attempting to authenticate...                                                   
2010/02/24 21:32:14 :: ['wpa_supplicant', '-B', '-i', 'wlan0', '-c', '/var/lib/wicd/configurations/001c4a4f9ef9', '-D', 'wext']                                                                               
2010/02/24 21:32:14 :: ['iwconfig', 'wlan0', 'essid', 'Gentoo']                                       
2010/02/24 21:32:15 :: iwconfig wlan0 channel 1                                                       
2010/02/24 21:32:15 :: iwconfig wlan0 ap 00:1C:4A:4F:9E:F9                                             
2010/02/24 21:32:15 :: WPA_CLI RESULT IS DISCONNECTED                                                 
2010/02/24 21:32:16 :: WPA_CLI RESULT IS ASSOCIATING                                                   
2010/02/24 21:32:17 :: WPA_CLI RESULT IS ASSOCIATING                                                   
2010/02/24 21:32:18 :: WPA_CLI RESULT IS ASSOCIATING                                                   
2010/02/24 21:32:19 :: WPA_CLI RESULT IS ASSOCIATED                                                   
2010/02/24 21:32:20 :: iwconfig wlan0                                                                 
2010/02/24 21:32:20 :: WPA_CLI RESULT IS COMPLETED                                                     
2010/02/24 21:32:20 :: Setting static IP : 192.168.178.22                                             
2010/02/24 21:32:20 :: ifconfig wlan0 192.168.178.22 netmask 255.255.255.0                             
2010/02/24 21:32:20 :: Setting default gateway : 192.168.178.1                                         
2010/02/24 21:32:20 :: route add default gw 192.168.178.1 dev wlan0                                   
2010/02/24 21:32:20 :: Setting DNS : 208.67.222.222                                                   
2010/02/24 21:32:20 :: Verifying AP association                                                       
2010/02/24 21:32:20 :: ping -q -w 3 -c 1 192.168.178.1                                                 
2010/02/24 21:32:20 :: Connecting thread exiting.                                                     
2010/02/24 21:32:20 :: ifconfig wlan0                                                                 
2010/02/24 21:32:20 :: IP Address is: 192.168.178.22                                                   
2010/02/24 21:32:25 :: Sending connection attempt result Success                                       
2010/02/24 21:32:25 :: ifconfig eth0                                                                   
2010/02/24 21:32:25 :: ifconfig wlan0                                                                 
2010/02/24 21:32:25 :: iwconfig wlan0
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 550
Location: Venice FL

PostPosted: Wed Feb 24, 2010 9:21 pm    Post subject: Reply with quote

toralf wrote:
You're sure that your network is up and running and provides valid DNS responses when ntp is starting ?


Thank you for asking that question, because I could not be sure until I tested it at that point in the boot process.

Well as it turned out in my case I had a script that setup my bridge (br0) and added the tap devices, it was launching prior to ntp-client and there was not enough time for it to settle for ntp-client to be happy, I forced it to launch earlier in the boot order and all is well again for me at the moment.

So it was my bad.

Thanks;

George
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 550
Location: Venice FL

PostPosted: Wed Feb 24, 2010 9:41 pm    Post subject: Reply with quote

samo wrote:
It seems like the connection is established too late. I get the following error in /var/log/messages.
Code:
Feb 24 21:32:11 gentoo ntpdate[3574]: no servers can be used, exiting
But at that time, the connection isn't established as I can see in /var/log/wicd/wicd.log


Is your network script launching in boot or the default runlevel?

I have my network script in boot, and by putting my bridge script in the boot runlevel also solved my particular issue.

Did you enable the rc.log ok?

George
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Wed Feb 24, 2010 9:57 pm    Post subject: Reply with quote

wicd runs in boot and ntp-client in default runlevel
Code:
# rc-update show
 * Broken runlevel entry: /etc/runlevels/boot/fbcondecor
           alsasound | boot
             apache2 |      default
            bootmisc | boot
             checkfs | boot
           checkroot | boot
               clock | boot
         consolefont | boot
               cupsd |      default
                dbus |      default
                hald |      default
            hostname | boot
             keymaps | boot
               local |      default nonetwork
          localmount | boot
             modules | boot
               mysql |      default
         mythbackend |      default
              net.lo | boot
            netmount |      default
          ntp-client |      default
           rmnologin | boot
              serial | boot
                sshd |      default
           syslog-ng |      default
      udev-postmount |      default
             urandom | boot
          vixie-cron |      default
                wicd | boot
                 xdm |      default
              xinetd |      default
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 550
Location: Venice FL

PostPosted: Wed Feb 24, 2010 10:28 pm    Post subject: Reply with quote

Bummer, I'll take a stab at it, maybe someone else has better ideas.

You might try adding the "after" command to push it further down to say something like after samba in the depend() clause in ntp-client or just add sleep 5 or how many seconds you need for the network to become active in the beginning of ntp-client or the end of wicd.

I don't know the openrc init system well enough to know if there are any options that wait for the network to be hot.

George
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Wed Feb 24, 2010 10:44 pm    Post subject: Reply with quote

Good hint. I will try it tomorrow.

Regarding the log wlan0 seems to need round about 25s. I will adjust /etc/init.d/ntp-client in the following way
Code:
depend() {
        before cron portmap
#       need net
        after net.wlan0 || after net.eth0
        use dns logger
# try 30
        add sleep 30
}

I'm unsure about the syntax.
Back to top
View user's profile Send private message
thumper
Guru
Guru


Joined: 06 Dec 2002
Posts: 550
Location: Venice FL

PostPosted: Wed Feb 24, 2010 11:01 pm    Post subject: Reply with quote

you may not want to put sleep in the depend clause.

Something like this in the start clause should work.
Code:

start() {
    checkconfig || return $?
   # sleep for 30s waiting for net
    sleep 30
    ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"


George
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Thu Feb 25, 2010 5:29 pm    Post subject: Reply with quote

Great, that's it. With the following line it works:
Code:
start() {
        checkconfig || return $?
# sleep for 10s
        sleep 10
        ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"
        "${NTPCLIENT_CMD}" ${NTPCLIENT_OPTS}
        eend $? "Failed to set clock"
}

Code:
2010/02/25 18:19:13 :: ---------------------------                                                                           
2010/02/25 18:19:13 :: wicd initializing...                                                                                 
2010/02/25 18:19:13 :: ---------------------------                                                                           
2010/02/25 18:19:13 :: wicd is version 1.6.2.2 463                                                                           
2010/02/25 18:19:13 :: setting backend to external                                                                           
2010/02/25 18:19:13 :: trying to load backend external                                                                       
2010/02/25 18:19:13 :: successfully loaded backend external                                                                 
2010/02/25 18:19:13 :: WARNING: No path found for udhcpc                                                                     
2010/02/25 18:19:13 :: WARNING: No path found for gksudo                                                                     
2010/02/25 18:19:13 :: WARNING: No path found for resolvconf                                                                 
2010/02/25 18:19:13 :: trying to load backend external                                                                       
2010/02/25 18:19:13 :: successfully loaded backend external                                                                 
2010/02/25 18:19:13 :: WARNING: No path found for udhcpc                                                                     
2010/02/25 18:19:13 :: WARNING: No path found for gksudo                                                                     
2010/02/25 18:19:13 :: WARNING: No path found for resolvconf                                                                 
2010/02/25 18:19:13 :: Couldn't detect a wireless interface.                                                                 
2010/02/25 18:19:13 :: setting wireless interface wlan0                                                                     
2010/02/25 18:19:13 :: automatically detected wired interface eth1                                                           
2010/02/25 18:19:13 :: setting wired interface eth0                                                                         
2010/02/25 18:19:13 :: setting wpa driver wext                                                                               
2010/02/25 18:19:13 :: setting use global dns to True                                                                       
2010/02/25 18:19:13 :: setting global dns                                                                                   
2010/02/25 18:19:13 :: global dns servers are 208.67.222.222 None None                                                       
2010/02/25 18:19:13 :: domain is None                                                                                       
2010/02/25 18:19:13 :: search domain is None                                                                                 
2010/02/25 18:19:13 :: setting automatically reconnect when connection drops True                                           
2010/02/25 18:19:13 :: found wired_connect_mode in configuration 1                                                           
2010/02/25 18:19:13 :: Setting dhcp client to 2                                                                             
2010/02/25 18:19:13 :: Wireless configuration file found...                                                                 
2010/02/25 18:19:13 :: Wired configuration file found...                                                                     
2010/02/25 18:19:13 :: chmoding configuration files 0600...                                                                 
2010/02/25 18:19:13 :: chowning configuration files root:root...                                                             
2010/02/25 18:19:13 :: Using wireless interface...wlan0                                                                     
2010/02/25 18:19:13 :: Using wired interface...eth0                                                                         
2010/02/25 18:19:13 :: scanning start                                                                                       
2010/02/25 18:19:13 :: ifconfig wlan0 up                                                                                     
2010/02/25 18:19:14 :: iwlist wlan0 scan                                                                                     
2010/02/25 18:19:18 :: hidden                                                                                               
2010/02/25 18:19:18 :: scanning done                                                                                         
2010/02/25 18:19:18 :: found 6 networks:                                                                                     
2010/02/25 18:19:18 :: found afterscript in configuration None                                                               
2010/02/25 18:19:18 :: found psk in configuration 3256da0781fb12ce15f680a13cb9225744ae7618dd3b33d4ec4c1497cb8e9601           
2010/02/25 18:19:18 :: found postdisconnectscript in configuration None                                                     
2010/02/25 18:19:18 :: found netmask in configuration 255.255.255.0                                                         
2010/02/25 18:19:18 :: found key in configuration 'password'                                                               
2010/02/25 18:19:18 :: found predisconnectscript in configuration None                                                       
2010/02/25 18:19:18 :: found gateway in configuration 192.168.178.1                                                         
2010/02/25 18:19:18 :: found use_global_dns in configuration 1                                                               
2010/02/25 18:19:18 :: found disconnect in configuration None                                                               
2010/02/25 18:19:18 :: found use_settings_globally in configuration 0                                                       
2010/02/25 18:19:18 :: found use_static_dns in configuration 1                                                               
2010/02/25 18:19:18 :: found ip in configuration 192.168.178.22                                                             
2010/02/25 18:19:18 :: found beforescript in configuration None                                                             
2010/02/25 18:19:18 :: found enctype in configuration wpa                                                                   
2010/02/25 18:19:18 :: found automatic in configuration True                                                                 
2010/02/25 18:19:18 :: found essid in configuration Gentoo                                                                   
2010/02/25 18:19:19 :: ifconfig eth0                                                                                         
2010/02/25 18:19:19 :: ifconfig wlan0                                                                                       
2010/02/25 18:19:19 :: iwconfig wlan0                                                                                       
2010/02/25 18:19:19 :: GetCurrentNetworkID: Returning -1, current network not found                                         
2010/02/25 18:19:19 :: Autoconnecting...                                                                                     
2010/02/25 18:19:19 :: ifconfig eth0 up                                                                                     
2010/02/25 18:19:21 :: Starting wireless autoconnect...                                                                     
2010/02/25 18:19:21 :: No wired connection present, attempting to autoconnect to wireless network                           
2010/02/25 18:19:21 :: scanning start                                                                                       
2010/02/25 18:19:21 :: ifconfig wlan0 up                                                                                     
2010/02/25 18:19:21 :: iwlist wlan0 scan                                                                                     
2010/02/25 18:19:24 :: hidden                                                                                               
2010/02/25 18:19:25 :: scanning done                                                                                         
2010/02/25 18:19:25 :: found 7 networks:                                                                                     
2010/02/25 18:19:25 :: found afterscript in configuration None                                                               
2010/02/25 18:19:25 :: found psk in configuration 3256da0781fb12ce15f680a13cb9225744ae7618dd3b33d4ec4c1497cb8e9601           
2010/02/25 18:19:25 :: found postdisconnectscript in configuration None                                                     
2010/02/25 18:19:25 :: found netmask in configuration 255.255.255.0                                                         
2010/02/25 18:19:25 :: found key in configuration 'password'                                                               
2010/02/25 18:19:25 :: found predisconnectscript in configuration None                                                       
2010/02/25 18:19:25 :: found gateway in configuration 192.168.178.1                                                         
2010/02/25 18:19:25 :: found use_global_dns in configuration 1                                                               
2010/02/25 18:19:25 :: found disconnect in configuration None                                                               
2010/02/25 18:19:25 :: found use_settings_globally in configuration 0                                                       
2010/02/25 18:19:25 :: found use_static_dns in configuration 1                                                               
2010/02/25 18:19:25 :: found ip in configuration 192.168.178.22                                                             
2010/02/25 18:19:25 :: found beforescript in configuration None                                                             
2010/02/25 18:19:25 :: found enctype in configuration wpa                                                                   
2010/02/25 18:19:25 :: found automatic in configuration True                                                                 
2010/02/25 18:19:25 :: found essid in configuration Gentoo                                                                   
2010/02/25 18:19:25 :: Gentoo has profile                                                                                   
2010/02/25 18:19:25 :: trying to automatically connect to...Gentoo                                                           
2010/02/25 18:19:25 :: Connecting to wireless network Gentoo                                                                 
2010/02/25 18:19:25 :: /sbin/dhcpcd -k eth0                                                                                 
2010/02/25 18:19:25 :: ifconfig eth0 0.0.0.0                                                                                 
2010/02/25 18:19:25 :: /sbin/ip route flush dev eth0                                                                         
2010/02/25 18:19:25 :: ifconfig eth0 down                                                                                   
2010/02/25 18:19:25 :: ifconfig eth0 up                                                                                     
2010/02/25 18:19:25 :: Putting interface down                                                                               
2010/02/25 18:19:25 :: ifconfig wlan0 down                                                                                   
2010/02/25 18:19:25 :: Releasing DHCP leases...                                                                             
2010/02/25 18:19:25 :: /sbin/dhcpcd -k wlan0                                                                                 
2010/02/25 18:19:25 :: Setting false IP...                                                                                   
2010/02/25 18:19:25 :: ifconfig wlan0 0.0.0.0                                                                               
2010/02/25 18:19:26 :: iwconfig wlan0                                                                                       
2010/02/25 18:19:26 :: Stopping wpa_supplicant                                                                               
2010/02/25 18:19:26 :: wpa_cli -i wlan0 terminate                                                                           
2010/02/25 18:19:26 :: Flushing the routing table...                                                                         
2010/02/25 18:19:26 :: /sbin/ip route flush dev wlan0                                                                       
2010/02/25 18:19:26 :: iwconfig wlan0 mode managed                                                                           
2010/02/25 18:19:26 :: Putting interface up...                                                                               
2010/02/25 18:19:26 :: ifconfig wlan0 up                                                                                     
2010/02/25 18:19:26 :: enctype is wpa                                                                                       
2010/02/25 18:19:26 :: Generating psk...                                                                                     
2010/02/25 18:19:26 :: ['/usr/bin/wpa_passphrase', 'Gentoo', 'password']                                                 
2010/02/25 18:19:26 :: Attempting to authenticate...                                                                         
2010/02/25 18:19:26 :: ['wpa_supplicant', '-B', '-i', 'wlan0', '-c', '/var/lib/wicd/configurations/001c4a4f9ef9', '-D', 'wext']                                                                                                                           
2010/02/25 18:19:26 :: ['iwconfig', 'wlan0', 'essid', 'Gentoo']                                                             
2010/02/25 18:19:26 :: iwconfig wlan0 channel 1                                                                             
2010/02/25 18:19:26 :: iwconfig wlan0 ap 00:1C:4A:4F:9E:F9                                                                   
2010/02/25 18:19:26 :: WPA_CLI RESULT IS DISCONNECTED                                                                       
2010/02/25 18:19:27 :: WPA_CLI RESULT IS ASSOCIATING                                                                         
2010/02/25 18:19:28 :: WPA_CLI RESULT IS ASSOCIATING                                                                         
2010/02/25 18:19:29 :: WPA_CLI RESULT IS ASSOCIATING                                                                         
2010/02/25 18:19:30 :: WPA_CLI RESULT IS ASSOCIATED                                                                         
2010/02/25 18:19:31 :: WPA_CLI RESULT IS ASSOCIATED                                                                         
2010/02/25 18:19:32 :: iwconfig wlan0                                                                                       
2010/02/25 18:19:32 :: WPA_CLI RESULT IS COMPLETED                                                                           
2010/02/25 18:19:32 :: Setting static IP : 192.168.178.22                                                                   
2010/02/25 18:19:32 :: ifconfig wlan0 192.168.178.22 netmask 255.255.255.0                                                   
2010/02/25 18:19:32 :: Setting default gateway : 192.168.178.1                                                               
2010/02/25 18:19:32 :: route add default gw 192.168.178.1 dev wlan0                                                         
2010/02/25 18:19:32 :: Setting DNS : 208.67.222.222                                                                         
2010/02/25 18:19:32 :: Verifying AP association                                                                             
2010/02/25 18:19:32 :: ping -q -w 3 -c 1 192.168.178.1                                                                       
2010/02/25 18:19:32 :: Connecting thread exiting.                                                                           
2010/02/25 18:19:32 :: ifconfig wlan0                                                                                       
2010/02/25 18:19:32 :: IP Address is: 192.168.178.22                                                                         
2010/02/25 18:19:37 :: Sending connection attempt result Success                                                             
2010/02/25 18:19:37 :: ifconfig eth0                                                                                         
2010/02/25 18:19:37 :: ifconfig wlan0                                                                                       
2010/02/25 18:19:37 :: iwconfig wlan0                                                                                       
2010/02/25 18:19:42 :: ifconfig eth0                                                                                         
2010/02/25 18:19:42 :: ifconfig wlan0                                                                                       
2010/02/25 18:19:42 :: iwconfig wlan0                                                                                       

Code:
Feb 25 18:19:35 gentoo ntpdate[3631]: step time server 64.73.32.135 offset -2.191652 sec

Seems like I can reduce the delay a little bit.

But I wonder, why the following line in /etc/init.d/ntp-client does not work:
Code:
depend() {
        before cron portmap
#       need net
        after net.wlan0 || after net.eth0
        use dns logger
}
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3920
Location: Hamburg

PostPosted: Thu Feb 25, 2010 7:20 pm    Post subject: Reply with quote

in every case
Code:
after net.wlan0 || after net.eth0
should be written as
Code:
after net.wlan0 net.eth0
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Thu Feb 25, 2010 9:30 pm    Post subject: Reply with quote

Thanks for the hint. But it does not help.
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1139
Location: Sofia/Bulgaria

PostPosted: Tue Mar 20, 2012 1:21 pm    Post subject: Reply with quote

samo wrote:
Great, that's it. With the following line it works:
Code:
 start() {
        checkconfig || return $?
# sleep for 10s
        sleep 10
        ebegin "Setting clock via the NTP client '${NTPCLIENT_CMD}'"
        "${NTPCLIENT_CMD}" ${NTPCLIENT_OPTS}
        eend $? "Failed to set clock"
}



Thank you!
That did the trick. :wink:
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
samo
Guru
Guru


Joined: 13 Mar 2004
Posts: 489

PostPosted: Sun Mar 25, 2012 3:22 pm    Post subject: Reply with quote

I don't know your problem, but I've found a better solution for my problem.
Back to top
View user's profile Send private message
Kollin
Veteran
Veteran


Joined: 25 Feb 2006
Posts: 1139
Location: Sofia/Bulgaria

PostPosted: Sun Mar 25, 2012 9:51 pm    Post subject: Reply with quote

samo wrote:
I don't know your problem, but I've found a better solution for my problem.


I don't use wicd ;)
_________________
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum