LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 11-14-2006, 07:33 AM   #1
Dannt
LQ Newbie
 
Registered: Oct 2006
Location: London, United Kingdom
Distribution: Ubuntu 6.10
Posts: 26

Rep: Reputation: 15
Problem at startup with NTPD


Hi,

I am currently running Fedora Core 5 on my machine. My issue is that when I recently tried to make the system clock to syncrhonize at the bootup, but unfortunately when the machine is booting the NTPD always fails.

Does anyone knows what can be causing that? Any help would be appreciated..

Many thanks..
 
Old 11-14-2006, 09:01 AM   #2
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Are you using a firewall? If you are you could try disabling it temporarily as root:

Code:
service iptables stop
then try as root:

Code:
ntpdate -u <timeserve_ip_address>
This should get a line with the current date and time. If this works then you would need to modify your iptables to allow port 123
 
Old 11-16-2006, 06:14 AM   #3
Dannt
LQ Newbie
 
Registered: Oct 2006
Location: London, United Kingdom
Distribution: Ubuntu 6.10
Posts: 26

Original Poster
Rep: Reputation: 15
Dear Fordeck,

Sorry I haven't replied earlier and many thanks for your help..

I tried to disable the firewall and then update the clock with
Quote:
ntpdate -u <timeserve_ip_address>
and it worked perfectly showing the time. Then I tried to open the port 123 first I did with the TDP protocol, then with UDP, then with both together and I still receive a "failed" message at the startup.

Furthermore I disable the firewall completely and rebooted the machine to find out the problem was still there:

Synchronizing NTP: [failed]

I have been googgling for a while and everyone seems to point out that this is a firewall issue, but provided I rebooted the pc without it enabled, I am starting to think something else might be wrong.

Thanks anyway for your help, if you do have any other suggestion please let me know and I can try it.

Best

Dannt
 
Old 11-16-2006, 07:07 AM   #4
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
Could you post your /etc/ntp.conf file? I could take a look at it and see if there are any issues.
 
Old 11-16-2006, 08:04 AM   #5
Dannt
LQ Newbie
 
Registered: Oct 2006
Location: London, United Kingdom
Distribution: Ubuntu 6.10
Posts: 26

Original Poster
Rep: Reputation: 15
Of course:

Quote:
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.

restrict default nomodify notrap noquery

# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict 127.0.0.1


# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service. Do not permit those systems to modify the
# configuration of this service. Also, do not use those
# systems as peers for synchronization.
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


# --- OUR TIMESERVERS -----
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org


# --- NTP MULTICASTCLIENT ---
#multicastclient # listen on default 224.0.1.1
# restrict 224.0.1.1 mask 255.255.255.255 nomodify notrap
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap



# --- GENERAL CONFIGURATION ---
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
fudge 127.127.1.0 stratum 10

#
# Drift file. Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
#
driftfile /var/lib/ntp/drift
broadcastdelay 0.008

#
# Keys file. If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
keys /etc/ntp/keys
restrict 0.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 1.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
restrict 2.pool.ntp.org mask 255.255.255.255 nomodify notrap noquery
 
Old 11-16-2006, 08:55 AM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Quote:
Furthermore I disable the firewall completely and rebooted the machine to find out the problem was still there:

Synchronizing NTP: [failed]
...So it is not a firewall problem!

At what stage in the boot process are you calling "ntpdate -u <timeserve_ip_address>" ? Maybe it is being called too soon (eg before networking is up).

I think I recall I had a similar problem when I first tried setting up ntp (and as I recall, I was trying to call it from /etc/rc.d/rc.local), and I worked around it like this:

I set up a cron job to call a script called "checkthetime" every hour. This script checks to see if ntp has synced my clock today. If it hasn't, it does. This has the advantage that I don't have to do a reboot to sync the time, and I am not calling the ntp servers unnecessairly often.

HTH
 
Old 11-16-2006, 09:43 AM   #7
Dannt
LQ Newbie
 
Registered: Oct 2006
Location: London, United Kingdom
Distribution: Ubuntu 6.10
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks Tredegar,

I think I realise what is happening clearer now, sorry if I didn't understood this first, but unfortunatelly more than 10 years using M$ Windows has dumbed me down to this point.

My computer connects to the Internet using a wireless card, and it is only after I log in into my user account when the Network Manager asks me to introduce the password for the keyring that holds the Wireless Network Key, and I have to do this everytime I log in any user account, so I believe there is not Internet connection before this.

Do you know by chance any way to prevent this keyring asking me for this password everytime I start? it isn't really necesary and from my point of view it is a waste of time. Otherwise I will find out how to do an script like the one Tredeger described.

Many thanks

Last edited by Dannt; 11-16-2006 at 09:45 AM.
 
Old 11-16-2006, 10:06 AM   #8
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,085

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
Glad you have realised where the problem lies!
Sorry, I do not use wireless, and am running KDE anyway, so cannot help you with "Network Manager". In KDE I would go to System Settings -> Network Settings, Select "Administrator Mode", give password, then R-click on my wireless interface, choose "Configure" and enter my ESSID / WEP keys (if I had them!). Surely there must be something similar for gnome.

Then you can play with cron and scripts (this was my first customise-linux-my-way project). I'll happily post my simple ntp script and crontab entry if this would help you.
 
Old 11-16-2006, 10:41 AM   #9
fordeck
Member
 
Registered: Oct 2006
Location: Utah
Posts: 520

Rep: Reputation: 61
I believe you can modify /etc/sysconfig/network-scripts/ifup-wireless with your key to automate your wireless startup. You could also add the following to the bottom of the file:

Code:
/usr/sbin/ntpdate uk.pool.ntp.org
  if [ -x /etc/init.d/ntpd]; then
    /etc/init.d/ntpd restart
  fi
Your /etc/ntp.conf looks like the default. Might I suggest that you use time servers in your region. Perhaps the following servers could replace

"# --- OUR TIMESERVERS -----" section of /etc/ntp.conf:

Code:
server 0.uk.pool.ntp.org
server 1.uk.pool.ntp.org
server 2.uk.pool.ntp.org
The iptables rules below may work for you:

Code:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 123 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m udp -p udp --dport 123 -j ACCEPT
Let me know if that helps?
 
Old 11-24-2006, 10:03 AM   #10
Dannt
LQ Newbie
 
Registered: Oct 2006
Location: London, United Kingdom
Distribution: Ubuntu 6.10
Posts: 26

Original Poster
Rep: Reputation: 15
Dear Fordeck

Firstly I wanted to apologise for not having post a reply since last week, finally I managed to solve the issue following your advise and editing the ifup-wireless script, so many thanks for your help.

I moved on now onto a new chalenge challenge; get the wireless card in Ubuntu.

Thanks for your help
 
  


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
GrSecurity ntpd problem humbletech99 Linux - Security 1 11-19-2005 05:17 AM
ntpd time server problem MGrosskopf Linux - Networking 0 02-06-2005 08:57 AM
ntpd jqcaducifer Linux - General 0 08-21-2003 11:09 PM
ntpd during system startup rusti999 Linux - Networking 2 12-08-2002 12:22 PM
ntpd setup/startup Bee Linux - General 0 12-04-2001 05:29 AM


All times are GMT -5. The time now is 07:13 AM.

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