LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 10-22-2009, 07:01 AM   #1
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Rep: Reputation: 44
ntp when not always connected


Hello,
I use the ntp daemon in my desktop PC, to keep my system in sync.
I'm not always connected... in these cases, ntp stops synchronizing. When running the command "ntpdc -p", I see that ntp is synchronizing only against localhost. This problem arises also when suspending the system, and then resuming.

Has anyone got some good suggestion to make ntp more error-resilient?
Obvious things could be using a cronjob to restart ntp, or controlling the output of "ntpdc" to check the list of servers... but maybe there's a more elegant solution
 
Old 10-22-2009, 07:43 AM   #2
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 530

Rep: Reputation: 50
If you are not always connected, you surely have some mechanism to unconnect from the internet, maybe some script.
Just add a kill ntpd command to it (or use some script to stop the ntpd daemon), and restart ntpd when you connect again.
You need root privileges to run the ntpd daemon correctly.
Give more details if you want something more precise.
 
Old 10-22-2009, 08:10 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.37, Debian Squeeze
Posts: 7,985
Blog Entries: 25

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
What happens if you do nothing? Doesn't ntpd just carry on synchronising to localhost until it can reach a time server? AFAIK that is the normal behaviour and probably "good enough" unless your hardware clock does not keep time well, in which case the only thing you can do to improve it is to ask ntpd to synchronise as soon as the Internet is connected.
 
Old 10-23-2009, 12:48 PM   #4
clvic
Member
 
Registered: Feb 2008
Location: Rome, Italy
Distribution: OpenSuSE 11.x, vectorlinux, slax, Sabayon
Posts: 206
Blog Entries: 2

Original Poster
Rep: Reputation: 44
Thanks for your replies.
berbae, my problem is that there are many reasons why I could be unconnected, and more than one way to become connected again. So, a script is not a very simple solution, as there are many points to check.

As of catkin's answer, I'll keep observing what happens... what do you mean with "ask ntpd to synchronise as soon as the Internet is connected"? By means of scripts attached to network connection events?
 
Old 10-23-2009, 03:31 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.37, Debian Squeeze
Posts: 7,985
Blog Entries: 25

Rep: Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009Reputation: 1009
Quote:
Originally Posted by clvic View Post
what do you mean with "ask ntpd to synchronise as soon as the Internet is connected"? By means of scripts attached to network connection events?
Yes -- the ifup scripts.
 
  


Reply

Tags
ntp


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 07:35 PM
not connected? printer 8300 series may not be connected c j alex Linux - Newbie 3 07-08-2008 09:41 AM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 02:04 PM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 02:22 PM
Limit connected items connected to my router andersh3 Linux - Newbie 1 03-16-2004 11:10 AM


All times are GMT -5. The time now is 01:41 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration