View previous topic :: View next topic |
Author |
Message |
dasPaul Apprentice


Joined: 14 Feb 2012 Posts: 222 Location: Dresden
|
Posted: Fri Aug 11, 2017 11:01 am Post subject: ntp-client wlan no servers can be used [solved] |
|
|
Hi
I've trouble getting ntp time on my raspberry pi with wlan stick.
I added ntp-client to default runlevel but it does not get the time from
the server.
/var/log/messages:
Code: |
...
Aug 11 12:51:20 astro ntpdate[1625]: no servers can be used, exiting
Aug 11 12:51:20 astro /etc/init.d/ntp-client[1607]: ERROR: ntp-client failed to start
...
|
/var/log/rc.log
Code: | rc boot logging started at Thu Jan 1 01:00:14 1970
* WARNING: clock skew detected!
* Setting the local clock based on last shutdown time ...
[ ok ]
* Checking local filesystems ...
/dev/sda1: sauber, 228370/1954064 Dateien, 1981905/7814144 Bloecke
[ ok ]
* Remounting root filesystem read/write ...
[ ok ]
* Remounting filesystems ...
[ ok ]
* Updating /etc/mtab ...
* Creating mtab symbolic link
[ ok ]
* Activating swap devices ...
[ ok ]
* Mounting local filesystems ...
[ ok ]
* The binfmt-misc module needs to be configured in /etc/conf.d/modules or built in.
* Mounting misc binary format filesystem ...
[ ok ]
* Loading custom binary format handlers ...
[ ok ]
* Configuring kernel parameters ...
[ ok ]
* Creating user login records ...
[ ok ]
* Wiping /tmp directory ...
[ ok ]
* Setting hostname to astro ...
[ ok ]
* Setting terminal encoding [UTF-8] ...
[ ok ]
* Setting keyboard mode [UTF-8] ...
[ ok ]
* Loading key mappings [de] ...
[ ok ]
* Bringing up network interface lo ...
[ ok ]
* Setting up tmpfiles.d entries ...
[ ok ]
* Initializing random number generator ...
[ ok ]
rc boot logging stopped at Fri Aug 11 12:51:14 2017
rc default logging started at Fri Aug 11 12:51:14 2017
* WARNING: clock skew detected!
* Bringing up interface eth0
* Caching network module dependencies
* 192.168.1.50 ...
[ ok ]
* Adding routes
* default via 192.168.1.1 ...
RTNETLINK answers: Network is unreachable
[ !! ]
[ !! ]
* Bringing up interface ra0
* Starting wpa_supplicant on ra0 ...
[ ok ]
* Starting wpa_cli on ra0 ...
[ ok ]
* Backgrounding ... ...
* WARNING: net.ra0 has started, but is inactive
* WARNING: netmount will start when net.ra0 has started
* Checking your configfile (/etc/syslog-ng/syslog-ng.conf) ...
[ ok ]
* Starting syslog-ng ...
[ ok ]
* Setting clock via the NTP client 'ntpdate' ...
* Failed to set clock
[ !! ]
* ERROR: ntp-client failed to start
* Starting sshd ...
[ ok ]
* Starting local ...
[ ok ]
rc default logging stopped at Fri Aug 11 12:51:20 2017
|
/etc/conf.d/ntp-client.conf
Code: | NTPCLIENT_CMD="ntpdate"
NTPCLIENT_OPTS="-s -b -u -t 10 \
0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org \
2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org"
# If you use hostnames above, then you should depend on dns
# being up & running before we try to run. Otherwise, you
# can disable this.
rc_use="dns" |
/etc/conf.d/net
Code: | config_eth0="192.168.1.50"
routes_eth0="default via 192.168.1.1"
config_ra0="192.168.1.51 netmask 255.255.255.0 brd 192.168.1.255"
routes_ra0="default via 192.168.1.1"
#config_ra0="dhcp"
modules_ra0="wpa_supplicant"
wpa_supplicant_ra0="-Dwext -d -f /var/log/wpa_supplicant.log" |
any ideas?
Last edited by dasPaul on Sat Aug 12, 2017 5:44 am; edited 2 times in total |
|
Back to top |
|
 |
dasPaul Apprentice


Joined: 14 Feb 2012 Posts: 222 Location: Dresden
|
Posted: Fri Aug 11, 2017 11:11 am Post subject: |
|
|
after login I can do ntpdate manually or restart the service i get proper ntp time. I also added "-t 10" to the NTPCLIENT_OPTS
to have a 10 seconds timeout but that seems to have no effect. |
|
Back to top |
|
 |
tberger2 Tux's lil' helper

Joined: 05 Feb 2013 Posts: 78
|
Posted: Fri Aug 11, 2017 11:14 am Post subject: |
|
|
try
/etc/rc.conf
Code: | rc_hotplug="!net.*"
rc_depend_strict="NO"
|
|
|
Back to top |
|
 |
dasPaul Apprentice


Joined: 14 Feb 2012 Posts: 222 Location: Dresden
|
Posted: Fri Aug 11, 2017 4:01 pm Post subject: |
|
|
no luck, ntp-client obviously keeps trying to connect to the server before ra0 is connected:
Code: |
Aug 11 17:31:41 astro ntpdate[1808]: name server cannot be used: Temporary failure in name resolution (-3)
Aug 11 17:31:41 astro /etc/init.d/ntp-client[1790]: ERROR: ntp-client failed to start
Aug 11 17:31:42 astro rpc.statd[1863]: Version 1.3.3 starting
Aug 11 17:31:42 astro rpc.statd[1863]: Flags: TI-RPC
Aug 11 17:31:42 astro rpc.statd[1863]: Running as root. chown /var/lib/nfs to choose different user
Aug 11 17:31:42 astro sshd[1889]: Server listening on 0.0.0.0 port 22.
Aug 11 17:31:42 astro sshd[1889]: Server listening on :: port 22.
Aug 11 17:31:43 astro kernel: ===>rt_ioctl_giwscan. 26(26) BSS returned, data->length = 4224
Aug 11 17:31:43 astro kernel: ==>rt_ioctl_siwfreq::SIOCSIWFREQ(Channel=9)
Aug 11 17:31:43 astro kernel: PeerBeaconAtJoinAction(): HT-CtrlChannel=9, CentralChannel=>9
Aug 11 17:31:43 astro kernel: PeerBeaconAtJoinAction(): Set CentralChannel=9
Aug 11 17:31:43 astro kernel: AdjustChannelRelatedValue(): Input BW=0, rf_channel=9, vht_bw=0, Channel=9, vht_cent_ch=0!
Aug 11 17:31:44 astro wpa_cli[1929]: interface ra0 CONNECTED
|
Code: | rc boot logging started at Thu Jan 1 01:00:16 1970
* WARNING: clock skew detected!
* Setting the local clock based on last shutdown time ...
[ ok ]
* Checking local filesystems ...
/dev/sda1: sauber, 232140/1954064 Dateien, 2014403/7814144 Bloecke
[ ok ]
* Remounting root filesystem read/write ...
[ ok ]
* Remounting filesystems ...
[ ok ]
* Updating /etc/mtab ...
* Creating mtab symbolic link
[ ok ]
* Activating swap devices ...
[ ok ]
* Mounting local filesystems ...
[ ok ]
* The binfmt-misc module needs to be configured in /etc/conf.d/modules or built in.
* Mounting misc binary format filesystem ...
[ ok ]
* Loading custom binary format handlers ...
[ ok ]
* Configuring kernel parameters ...
[ ok ]
* Creating user login records ...
[ ok ]
* Wiping /tmp directory ...
[ ok ]
* Setting hostname to astro ...
[ ok ]
* Setting terminal encoding [UTF-8] ...
[ ok ]
* Setting keyboard mode [UTF-8] ...
[ ok ]
* Loading key mappings [de] ...
[ ok ]
* Bringing up network interface lo ...
[ ok ]
* Setting up tmpfiles.d entries ...
[ ok ]
* Initializing random number generator ...
[ ok ]
rc boot logging stopped at Fri Aug 11 17:31:35 2017
rc default logging started at Fri Aug 11 17:31:35 2017
* WARNING: clock skew detected!
* Bringing up interface eth0
* Caching network module dependencies
* 192.168.1.50 ...
[ ok ]
* Adding routes
* default via 192.168.1.1 ...
RTNETLINK answers: Network is unreachable
[ !! ]
[ !! ]
* Bringing up interface ra0
* Starting wpa_supplicant on ra0 ...
[ ok ]
* Starting wpa_cli on ra0 ...
[ ok ]
* Backgrounding ... ...
* WARNING: net.ra0 has started, but is inactive
* Mounting network filesystems ...
[ ok ]
* Checking your configfile (/etc/syslog-ng/syslog-ng.conf) ...
[ ok ]
* Starting syslog-ng ...
[ ok ]
* Setting clock via the NTP client 'ntpdate' ...
Exiting, name server cannot be used: Temporary failure in name resolution (-3) * Failed to set clock
[ !! ]
* ERROR: ntp-client failed to start
* Starting rpcbind ...
[ ok ]
* Starting NFS statd ...
[ ok ]
* Starting sshd ...
[ ok ]
* Starting local ...
[ ok ]
rc default logging stopped at Fri Aug 11 17:31:43 2017
|
Code: |
rc-update
binfmt | boot
bootmisc | boot
devfs | sysinit
dmesg | sysinit
fsck | boot
hostname | boot
keymaps | boot
killprocs | shutdown
kmod-static-nodes | sysinit
local | default nonetwork
localmount | boot
loopback | boot
modules | boot
mount-ro | shutdown
mtab | boot
net.eth0 | default
net.ra0 | default
netmount | default
ntp-client | default
opentmpfiles-dev | sysinit
opentmpfiles-setup | boot
procfs | boot
root | boot
rpc.statd | default
savecache | shutdown
sshd | default
swap | boot
swclock | boot
sysctl | boot
sysfs | sysinit
syslog-ng | default
termencoding | boot
udev | sysinit
udev-trigger | sysinit
urandom | boot
|
|
|
Back to top |
|
 |
Ant P. Watchman

Joined: 18 Apr 2009 Posts: 6921
|
Posted: Sat Aug 12, 2017 3:14 am Post subject: |
|
|
Use a proper ntp daemon like chrony instead, ntp-client is only useful for permanently connected wired networks. |
|
Back to top |
|
 |
tberger2 Tux's lil' helper

Joined: 05 Feb 2013 Posts: 78
|
Posted: Sat Aug 12, 2017 5:29 am Post subject: |
|
|
I use net-misc/htpdate with this configuration successfully. |
|
Back to top |
|
 |
dasPaul Apprentice


Joined: 14 Feb 2012 Posts: 222 Location: Dresden
|
Posted: Sat Aug 12, 2017 5:43 am Post subject: |
|
|
I replaced ntp-client with chrony. I get ntp time now.
Thanks! |
|
Back to top |
|
 |
|