Problem with system time

Questions about applications and software
Forum rules
Before you post please read how to get help
b0nz0
Level 1
Level 1
Posts: 22
Joined: Thu Feb 03, 2011 6:46 am

Problem with system time

Post by b0nz0 »

I am using mint 10, my system time keeps changing again and again after each login on every account.
Please guide.
wayne128
Level 10
Level 10
Posts: 3412
Joined: Tue Jul 13, 2010 12:15 am

Re: Problem with system time

Post by wayne128 »

Not sure if these help.

I normally do two things when time is not playing nice.

1. check to be sure timezone is correct, terminal command is

dpkg-reconfigure tzdata

2. install ntp so that clock sync with it, command is

apt-get install ntp

after this is install, I wait for a while, usually 1-2 minute and see that time is adjusted to my timezone data.

your mileage may vary. depending on your system and many settings
b0nz0
Level 1
Level 1
Posts: 22
Joined: Thu Feb 03, 2011 6:46 am

Re: Problem with system time

Post by b0nz0 »

How does ntp going to help?
User avatar
xenopeek
Level 24
Level 24
Posts: 24846
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Problem with system time

Post by xenopeek »

There is also a front-end to NTP you can use to configure it.

Code: Select all

sudo apt-get install gnome-time-admin
Then in Linux Mint 11 go to Menu -> Control Center -> Time and Date, unlock, and change Configuration to "Keep synchronized with Internet servers." You can add servers local to your country, look them up at http://www.pool.ntp.org.
Image
LazLong
Level 1
Level 1
Posts: 2
Joined: Thu Jul 14, 2011 1:08 am

Re: Problem with system time

Post by LazLong »

xenopeek wrote:There is also a front-end to NTP you can use to configure it.

Code: Select all

sudo apt-get install gnome-time-admin
Then in Linux Mint 11 go to Menu -> Control Center -> Time and Date, unlock, and change Configuration to "Keep synchronized with Internet servers." You can add servers local to your country, look them up at http://www.pool.ntp.org.
Did that before I came here looking for help. No change. I shouldn't have to manually set the time. Hell, even XP came with an NTP client.

Yes, I'm cranky, and just want it to go. I'm looking for things....Things to make it go! ;-)
User avatar
subeh.sharma
Level 2
Level 2
Posts: 50
Joined: Fri Jul 15, 2011 5:43 am

Re: Problem with system time

Post by subeh.sharma »

I had the same problem but it went away after i install NTP as suggested earlier in this post. It does take couple of minutes to sync, though. Thanks for help!

Subeh
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

xenopeek wrote: Then in Linux Mint 11 go to Menu -> Control Center -> Time and Date, unlock, and change Configuration to "Keep synchronized with Internet servers."
My system clock is out of sync again, although I installed ntpd. So I thought that ntpd is probably not running. At least it does not show up in the System Monitor. SO I started Control Center and wanted to turn on this option "Keep synchronized with Internet servers", but there is no "Time and Date" menu item in the Control Center. I tried to seek for it, but without success.

Could somebody tell me please what should I do in order to have ntpd running every time I start the system. I have LM 11.
User avatar
xenopeek
Level 24
Level 24
Posts: 24846
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Problem with system time

Post by xenopeek »

Liza, did you install gnome-time-admin? Also, this may work differently on Linux Mint 12...
Image
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

Oh, right, I did not install it. Sorry for bothering you! Now it works fine.
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

I installed gnome-time-admin, and as far as I can see, it is configured. This happened about 1,5 hours ago, but my system time is still 2 Minutes behind the real time, just like it has been before. How can I check if ntp is running and doing things properly?
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

Oh, great, now my system time is set to August 27, 2010. I have absolutely no idea how it happened. :shock: What do I do now?!

Addition: I set the time back manually. NTP is still not working. :(
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

I found the ntpd process in the System MOnitor application. It is sleeping. Please can somebody tell me how to find out if NTP is working properly? Is there some command line command for this?

For example, I found this command:

> ntpq -p

I got the output that looks like this:
remote refid st t when poll reach delay offset jitter
==============================================================================
hostname1 .INIT. 16 u - 256 0 0.000 0.000 0.000
hostname2 .INIT. 16 u - 256 0 0.000 0.000 0.000
hostname3 .INIT. 16 u - 256 0 0.000 0.000 0.000
hostname4 .INIT. 16 u - 256 0 0.000 0.000 0.000
hostname5 .INIT. 16 u - 256 0 0.000 0.000 0.000

Still, I don't know if NTP is working properly, because I don't know where to find how the output of the command looks like.

And, to be honest, I just want it to work without spending 3 hours of my working time on it. :evil: I know this is not the right attitude if one decided to use Linux, but here it is. Quite simple things just do not work. :(
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

I'd be delighted to get some advice. It should be possible to use this "Time&Date" thing.
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

So there is absolutely nobody here who could help me with NTP? Could at least somebody who also uses "Time&Date" with LM 11 tell me if NTP runs at their computer? What is the output of this command, for example:

> ntpq -p
User avatar
xenopeek
Level 24
Level 24
Posts: 24846
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Problem with system time

Post by xenopeek »

xenopeek wrote:There is also a front-end to NTP you can use to configure it.

Code: Select all

sudo apt-get install gnome-time-admin
Then in Linux Mint 11 go to Menu -> Control Center -> Time and Date, unlock, and change Configuration to "Keep synchronized with Internet servers." You can add servers local to your country, look them up at http://www.pool.ntp.org.
Did you do what is noted in the last line? I didn't do anything special on Linux Mint, except install the gnome-time-admin, configure to synchronize with Internet servers and added the proper ntp server pools for my country.

He is the output of the command you asked, run on my machine:

Code: Select all

xenopeek@katya ~ $ ntpq -p
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+194.109.64.200  192.87.106.3     2 u   28   64  177   17.997   -1.511   0.498
+grendel.exizten 130.149.17.8     2 u   26   64  177   23.871   -1.594   0.550
-85.12.35.12     193.79.237.14    2 u   28   64  177   17.932   -0.148   0.672
*panoramix.linoc 82.95.215.61     2 u   25   64  177   24.067   -0.987   0.411
Configuration is in /etc/ntp.conf. Here is my file, the last four lines where added when I added the proper ntp server pools for my country from the GUI as indicated.

Code: Select all

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift


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

# Use Ubuntu's ntp server as a fallback.

# 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
server 0.nl.pool.ntp.org 
server 1.nl.pool.ntp.org
server 2.nl.pool.ntp.org
server 3.nl.pool.ntp.org
Image
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

I did everything that is described in your previous posts. Still, your NTP is obviously working, and mine is obviously not.

Thank you for posting your outputs. I also have different host names in /etc/ntp.conf and in the output of ntpq, so I thought this might be the problem. But as you also have it, then it seems to be okay.

My assumption is that the port 123 is somewhere blocked. I don't know how to check it, and what to do about it. Any ideas?
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

This might be something else:

Your servers have "st" (stratum) 2, and my servers have st 16. Probably this is the problem. Anyway, why the output of ntpq shows servers that are different from the ones in ntp.conf? This seems strange to me.
User avatar
xenopeek
Level 24
Level 24
Posts: 24846
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Problem with system time

Post by xenopeek »

Stratum is explained here: https://en.wikipedia.org/wiki/Network_T ... ock_strata. I'm not sure if st 16 is a problem, though st 2 sounds better :wink:
Liza wrote:Anyway, why the output of ntpq shows servers that are different from the ones in ntp.conf? This seems strange to me.
I don't have servers configured in ntp.conf, I have server pools configured. There can be a whole bunch of servers in a pool. Refer to http://www.pool.ntp.org to find a good server pool for you.
Image
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

I already said that I did it. Okay, I haven't read about server pools, so thanks for the information.

So it might really be that port 123 is blocked. How can I check it?

Addition: Google says that stratum 16 is the lowest level possible, so it seems the servers are just not reachable by NTP. I can ping the server pools and the server form the ntpq output, though.
Liza
Level 2
Level 2
Posts: 54
Joined: Wed Aug 31, 2011 3:49 am

Re: Problem with system time

Post by Liza »

Found in Google advice on how to check the UDP port. The output is okay, UDP 123 is opened at localhost and at one of the remote time servers:

> sudo nmap -p 123 -sU -P0 localhost

Starting Nmap 5.21 ( http://nmap.org ) at 2012-03-29 17:36 CEST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00014s latency).
PORT STATE SERVICE
123/udp open ntp

> sudo nmap -p 123 -sU -P0 ntp.ubuntu.org

Starting Nmap 5.21 ( http://nmap.org ) at 2012-03-29 17:40 CEST
Nmap scan report for ntp.ubuntu.org (147.83.195.55)
Host is up.
rDNS record for 147.83.195.55: agora3.upc.edu
PORT STATE SERVICE
123/udp open|filtered ntp

So, I really don't know what to do next. Probably I should ask at some other forum here or somewhere else?
Post Reply

Return to “Software & Applications”