Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-27-2007, 04:52 AM   #1
Registered: Sep 2005
Location: Vienna, Austria
Distribution: Mint 13
Posts: 524

Rep: Reputation: 31
ntpdate doesn´t work by booting


I wrote a 1 line script to use ntpdate. wenn I start the script manually it works. I put it in /etc/init.d and made symbolic links in /etc/rc3.d/and /etc/rc5.d/. But it doesn´t work when I boot. I still have to run the script manually. Can´ t work ntpdate during booting?
Old 04-27-2007, 05:07 AM   #2
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
It won't work unless the network is already up.
Old 04-27-2007, 12:22 PM   #3
LQ 5k Club
Registered: May 2003
Location: London, UK
Distribution: Debian "Testing"
Posts: 6,096

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
Here's my solution:
I don't want the time checking more often than once a day (I do not want to annoy those timeservers!)

I put this line in root's crontab
5 * * * * /usr/sbin/chktime
So the script chktime is called at five minutes past every hour.

This is the script, it is very simple:
# chktime 
# No need to check the time more than once a day, no matter how often
# this script is called
# Note the date format: we do NOT want spaces in the date!
NOW=`date +%a%b%d`
LAST=`cat /etc/.lasttimecheck`
if [ "$NOW" != "$LAST" ]; then
	echo -n $NOW > /etc/.lasttimecheck
	/usr/sbin/ntpdate ; echo "ntpdate set the date" >> /var/log/messages


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
vnc4server doesn`t work! tyranus Debian 4 06-02-2006 06:08 PM
Wi-Fi doesn;t work on Suse 9.3 hackerarchangel Linux - Hardware 2 10-18-2005 12:59 PM
Microphone doesn' work Lars79 Slackware 20 08-30-2005 09:24 AM
NTPDATE will *NOT* work jon_k Linux - Software 8 01-02-2005 05:41 AM
kopete doesn´t work maZ Linux - Software 1 07-31-2003 03:51 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:49 PM.

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