LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 01-01-2015, 07:30 AM   #1
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware and Debian
Posts: 520

Rep: Reputation: 110Reputation: 110
sntp is not consistent on Raspberry Pi


I am running an RPi with a FatDog installer. sntp is not consistent, probably since the last ntp update from slackwarearm.

I edited /etc/rc.d/rc.local to call ntpdate instead:

Quote:
echo "Setting the time:"
echo " /usr/sbin/ntpdate pool.ntp.org > /dev/null &"
/usr/sbin/ntpdate pool.ntp.org > /dev/null &

Last edited by ChrisAbela; 01-08-2015 at 02:34 PM.
 
Old 01-08-2015, 10:30 AM   #2
DarrenDrapkin
Member
 
Registered: Aug 2014
Location: Leeds, England
Distribution: Slackware x86 64 current
Posts: 61

Rep: Reputation: 8
I do not have a Pi but,I think that this is a hardware problem. The Pi, as far as I know, does not have a real time clock,leading all automated time programmes to fail. Someone tell me that I'm wrong.
 
Old 01-08-2015, 02:34 PM   #3
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware and Debian
Posts: 520

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
I do not have a Pi but,I think that this is a hardware problem. The Pi, as far as I know, does not have a real time clock,leading all automated time programmes to fail. Someone tell me that I'm wrong.
You are correct, the RPi does not have an RTC. I am using ntpdate to set the system time. Previously I used sntp, which now does not always work.

Chris
 
Old 01-10-2015, 04:33 AM   #4
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 705

Rep: Reputation: 72
The FatDog install image should not be the issue, it is only an installer image. What was the problem with sntp? you told us what you were using instead of sntp, but what was the output from sntp that seemed inconsistant? I have had no problems with it running 14.1 and current (November 2014).
 
1 members found this post helpful.
Old 01-10-2015, 02:14 PM   #5
ChrisAbela
Member
 
Registered: Mar 2008
Location: Malta
Distribution: Slackware and Debian
Posts: 520

Original Poster
Rep: Reputation: 110Reputation: 110
Quote:
What was the problem with sntp? you told us what you were using instead of sntp, but what was the output from sntp that seemed inconsistant? I have had no problems with it running 14.1 and current (November 2014).
You may note thay sntp fails, but after I set the time via ntpdate, sntp runs correctly:

Quote:
root@raspberrypi:~# /usr/sbin/sntp -s it.pool.ntp.org
sntp 4.2.8@1.3265-o Fri Dec 26 17:54:55 UTC 2014 (1)
1970-01-01 01:02:35.190286 (-0100) +1420920081.06499 +/- 947280054.077984 it.pool.ntp.org 62.48.53.90 s2
adj_systime: Invalid argument
root@raspberrypi:~# /usr/sbin/ntpdate it.pool.ntp.org
10 Jan 21:04:13 ntpdate[739]: step time server 62.48.53.90 offset 1420920080.995730 sec
You have mail in /var/spool/mail/root
root@raspberrypi:~# /usr/sbin/sntp -s it.pool.ntp.org
sntp 4.2.8@1.3265-o Fri Dec 26 17:54:55 UTC 2014 (1)
2015-01-10 21:04:24.930491 (-0100) +0.000152 +/- 0.055694 it.pool.ntp.org 212.121.88.250 s3
root@raspberrypi:~#
 
Old 01-12-2015, 05:56 AM   #6
justwantin
Member
 
Registered: Aug 2003
Location: Melbourne, Australia
Distribution: Slackware, Slackwarearm
Posts: 705

Rep: Reputation: 72
Well... there may be a difference with what you and I are doing...........

I use the following, called from a script in /etc/wicd/scripts/postconnect.
Code:
/usr/sbin/sntp -s pool.ntp.org
Every time a Pi boots and wicd kicks in the Pi has has the correct time.
 
Old 01-13-2015, 06:18 AM   #7
louigi600
Member
 
Registered: Dec 2013
Location: Italy
Distribution: Slackware
Posts: 480
Blog Entries: 13

Rep: Reputation: 43
I use this on all my systems to put the time right (even when it's way off):
Code:
ntpdate -b pool.ntp.org
I even do that before starting ntpd (on the systems where that's configured) just to make sure that ntpd reaches working statum as quickly as possible.
On system where there is a working hardware clock al also do this
Code:
hwclock -w
after having synced with pool.ntp.org.
 
Old 03-30-2018, 01:12 PM   #8
lazardo
Member
 
Registered: Feb 2010
Location: SF Bay Area
Posts: 191

Rep: Reputation: Disabled
Actually a step/slew issue, settimeofday is the correct choice:
Code:
sntp -S 3.us.pool.ntp.org
Now I won't forget
 
Old 04-02-2018, 02:06 AM   #9
Penthux
Member
 
Registered: Dec 2008
Location: Middlesbrough, UK
Distribution: Slackware
Posts: 212

Rep: Reputation: 62
Quote:
Originally Posted by louigi600 View Post
I use this on all my systems to put the time right (even when it's way off)
On a Slackware ARM system I'd use this;
Code:
root@slackware:~# ntpdate -b 0.pool.ntp.org
Or this;
Code:
root@slackware:~# ntpd -b 0.pool.ntp.org
When no network connection is available I'd set the date/time manually and use this;
(Example used is midday on Sunday, April 01 2018)
Code:
root@slackware:~# date 040112002018.00
Or this;
Code:
root@slackware:~# date -s "Sun Apr 01 12:00:00 2018"
If accurate time is always a consideration then I'd recommend to setup a Raspberry Pi as a NTP server. If you have a spare RPi device laying around it would be a perfect use for it. I did exactly that and use this RPi to set the date/time on all my computer systems around the house.

Code:
root@vuur:~# ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 LOCAL(0)        .LOCL.          10 l 115d   64    0    0.000    0.000   0.000
 192.168.10.71   .XFAC.          16 B    -   64    0    0.000    0.000   0.004
*glfd-dmzutil-1. 10.178.1.162     2 u 1073 1024  377   24.842   -2.101   2.248
+ntp0.nl.uu.net  .GPS.            1 u  793 1024  377   19.515   -0.450   0.976
-turnip.mc.man.a 193.62.22.74     2 u  919 1024  377   31.140   -1.059   0.737
+139.59.199.215  82.69.223.180    2 u 1018 1024  377   20.305   -3.778   1.318

root@vuur:~# date
Mon Apr  2 07:49:17 BST 2018
From another system on the network I just do this:

Code:
root@drie:~# ntpdate -b 192.168.10.71
 2 Apr 07:50:09 ntpdate[4179]: step time server 192.168.10.71 offset 0.002963 sec
root@drie:~# date
Mon Apr  2 07:50:16 BST 2018
I have a slight addiction to RTCs and have collected quite a sum of them over the years. Of which, I've found the DS3231 to be the best by far and have them installed in almost all my RPis. A real time clock is always good for a back-up solution, whether it's ever needed or not.

"Time is the school in which we learn,
Time is the fire in which we burn.
"
[Delmore Schwartz]

Last edited by Penthux; 04-02-2018 at 02:11 AM. Reason: forgot link and I want bagels for breakfast!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Loopback device significance on SNTP nilathinesh Linux - Networking 5 10-14-2011 01:43 AM
SNTP on Redhat yong123 Linux - Software 2 10-07-2010 10:29 PM
SNTP server in fedora for lan mukesh_komalan Linux - Newbie 0 01-04-2008 07:08 AM
configuring sntp on linux afruto Linux - Networking 0 04-02-2006 11:23 AM
which kernel version supports SNTP v4 prasannapm Linux - Software 2 02-07-2006 08:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration