Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-11-2013, 11:09 AM
|
#1
|
Member
Registered: Jan 2004
Posts: 539
Rep:
|
NTP synchronization error?
I installed the ntp in kubuntu 13.04, the date is correct but the time is not set correct, the local time is same as the UTC time, my local time zone is set correctly, this is the /etc/ntp.conf:
Quote:
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
logfile /var/log/xntpd
driftfile /var/lib/ntp/ntp.drift
statsdir /var/log/ntpstats/
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable
# Specify one or more NTP servers.
# Use servers from the NTP Pool Project. Approved by Ubuntu Technical Board
# on 2011-02-08 (LP: #104525). See http://www.pool.ntp.org/join.html for
# more information.
server 0.ubuntu.pool.ntp.org
server 1.ubuntu.pool.ntp.org
server 2.ubuntu.pool.ntp.org
server 3.ubuntu.pool.ntp.org
##
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
server 3.pool.ntp.org
# Use Ubuntu's ntp server as a fallback.
server ntp.ubuntu.com
# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details. The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.
# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery
# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1
# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust
# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255
# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines. Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient
|
and this is ntpq -p command i don't know if this can help:
Quote:
remote refid st t when poll reach delay offset jitter
==============================================================================
+113.30.137.34 108.199.26.138 3 u 51 128 377 249.634 -24.005 10.312
-31.169.iconpln. 111.92.175.248 3 u 43 128 377 223.382 -58.500 13.574
-120-88-47-10.in 10.84.87.146 2 u 48 128 377 394.758 45.819 9.373
+superluminal.sf 131.113.192.40 2 u 98 128 377 400.725 -4.357 7.560
-beitel.indoforu 47.187.174.51 2 u 46 128 377 237.214 -96.126 16.586
-ec2-54-254-17-2 203.123.48.219 2 u 107 128 377 307.772 79.869 18.120
-202.71.100.89 203.106.109.85 4 u 100 128 355 124.975 -2.709 157.665
*europium.canoni 193.79.237.14 2 u 44 128 375 198.921 -36.770 10.791
|
Last edited by shams; 10-11-2013 at 11:12 AM.
|
|
|
10-11-2013, 01:56 PM
|
#2
|
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,291
|
Your system time is within 100 msec of 8 different servers. Why do you believe it is not correct? What does "date" print and your phone show, for example?
Also check $TZ and /etc/localtime.
|
|
|
10-11-2013, 02:13 PM
|
#3
|
Moderator
Registered: Aug 2002
Posts: 26,638
|
If you time zone is set correctly then the problem is typically due to the fact that your hardware clock is set to local time but the OS thinks it is UTC or vice versa.
Check the /etc/default/rcS file to see if utc=yes or no and check the hardwark clock time.
|
|
|
10-12-2013, 06:02 AM
|
#4
|
Member
Registered: Jan 2004
Posts: 539
Original Poster
Rep:
|
Thanks for reply the, in the file /etc/default/rcS utc is set to yes:
Quote:
# assume that the BIOS clock is set to UTC time (recommended)
UTC=yes
|
amd the hardware clock is also set to UTC:
Quote:
# hwclock -r
UTC 03:52:21 -0.188043 seconds
|
now how i can solve this problem please?
|
|
|
10-12-2013, 07:44 AM
|
#5
|
Moderator
Registered: Aug 2002
Posts: 26,638
|
What is your time zone?
Post the output of the command:
zdump -v /etc/localtime | grep 2013
|
|
|
10-12-2013, 11:36 AM
|
#6
|
Member
Registered: Jan 2004
Posts: 539
Original Poster
Rep:
|
My time zone is +4:30 and given command have no any output:
Quote:
# zdump -v /etc/localtime | grep 2013
|
The /etc/timezone file has the correct entry for my time zone.
Last edited by shams; 10-12-2013 at 11:50 AM.
|
|
|
10-12-2013, 01:35 PM
|
#7
|
Moderator
Registered: Aug 2002
Posts: 26,638
|
Also try
zdump -v /etc/localtime
and
zdump -v <your_time_zone> (Use actial time zone)
You should see a bunch of time zone data. The output of the files should match.
https://help.ubuntu.com/community/UbuntuTime
|
|
|
10-12-2013, 08:55 PM
|
#8
|
Member
Registered: Jan 2004
Posts: 539
Original Poster
Rep:
|
Thesee are the outputs of above commands:
Quote:
# zdump -v /etc/localtime
/etc/localtime Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 20:45:52 1901 UTC isdst=0 gmtoff=0
/etc/localtime Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 20:45:52 1901 UTC isdst=0 gmtoff=0
/etc/localtime Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 03:14:07 2038 UTC isdst=0 gmtoff=0
/etc/localtime Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 03:14:07 2038 UTC isdst=0 gmtoff=0
|
Quote:
# zdump -v +4:30
+4:30 Fri Dec 13 20:45:52 1901 UTC = Fri Dec 13 20:45:52 1901 isdst=0 gmtoff=0
+4:30 Sat Dec 14 20:45:52 1901 UTC = Sat Dec 14 20:45:52 1901 isdst=0 gmtoff=0
+4:30 Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 03:14:07 2038 isdst=0 gmtoff=0
+4:30 Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 03:14:07 2038 isdst=0 gmtoff=0
|
I think there is going something wrong?
|
|
|
10-13-2013, 08:19 AM
|
#9
|
Moderator
Registered: Aug 2002
Posts: 26,638
|
All of my systems are the same...
Using time zone aft-4:30 will give you a +4:30 UTC offset.
Code:
zdump -v aft-4:30
aft-4:30 Fri Dec 13 20:45:52 1901 UTC = Sat Dec 14 01:15:52 1901 aft isdst=0 gmtoff=16200
aft-4:30 Sat Dec 14 20:45:52 1901 UTC = Sun Dec 15 01:15:52 1901 aft isdst=0 gmtoff=16200
aft-4:30 Mon Jan 18 03:14:07 2038 UTC = Mon Jan 18 07:44:07 2038 aft isdst=0 gmtoff=16200
aft-4:30 Tue Jan 19 03:14:07 2038 UTC = Tue Jan 19 07:44:07 2038 aft isdst=0 gmtoff=16200
Last edited by michaelk; 10-13-2013 at 08:20 AM.
|
|
|
10-13-2013, 12:40 PM
|
#10
|
Member
Registered: Jan 2004
Posts: 539
Original Poster
Rep:
|
Any idea how to get the correct system time with ntp now?
|
|
|
10-13-2013, 01:29 PM
|
#11
|
Moderator
Registered: Aug 2002
Posts: 26,638
|
Set your time zone for aft-4:30
|
|
|
All times are GMT -5. The time now is 06:52 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|