ntpd vs ntpdate - Red Hat (RHEL5)

I was instructed to set up NTP with authentication on our linux machines.  We are using Cisco devices as our time servers on our network.

I tested authentication on one of our RHEL 6 boxes and was able to setup authentication and sync with the server.

As I went to config it on one of our RHEL 5 machines I noticed that there is not ntpdate service, only ntpd.  It was my understanding that ntpd (network time protocol daemon) was the server and ntpdate was the client.  It seems that in RHEL 5 there is no ntpdate, so if I want the machine to ONLY be a client do I use ntpd?

Can someone explain this?  For the RHEL 5 machines am I using ntpd as the client?  Also how can I make it so machines can not look at these clients for time updates?
LVL 23
savoneAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

farzanjCommented:
ntpdate is a utility that is provided by the rpm called 'ntp'.  It is not the client.  For synchronizing you need ntpd installed and configured.  ntpdate would onlyl synchronize once and that too when ntpd is stopped and not running.

you can see if you have it

rpm -qa | grep ntp

Try doing
/usr/sbin/ntpdate

May be you have it just that your path is not adjusted.
0
Andrew Hancock (VMware vExpert / EE MVE^2)VMware and Virtualization ConsultantCommented:
ntpd is a daemon that runs to keep your time up to date/time. For this you must configure ntp.conf so it will know where to get the date/time

ntpdate is a command that will use ntp.conf to do an update now as opposed to waiting for ntpd to do it.

If you want you want ntpd, you need to configure ntp.conf. You CAN use ntpdate to do manual updates.

http://www.brennan.id.au/09-Network_Time_Protocol.html
0
farzanjCommented:
With ntpdate command, you can provide the name of time server manually too and that would eliminate the need of having /etc/ntp.conf file at all.

service ntpd stop
ntpdate <servername>
service ntpd start


Regardless, you need to provide server parameter in /etc/ntp.conf to keep your time synchronized.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

farzanjCommented:
To see your jitter and time and whether your time server is synchronized or not, you can issue the following command

ntpq -p
0
upanwarCommented:
You no need to stop and start again the ntpd deamon. You can execute the ntpdate command while ntpd deamon is running but you need to use -d for the same.

# ntpdate -d <Time server name/ip>

If you will not use -d with ntpdate then you would require to stop the ntpd service.
0
savoneAuthor Commented:
Ok, I understand what everyone is trying to say here and I appreciate it.  BUT, as you can see below ntpdate is clearly set up as a service with its own startup scripts in /etc/init.d/.  This is in RHEL 6


# chkconfig --list | grep ntp
ntpd                 0:off      1:off      2:off      3:off      4:off      5:off      6:off
ntpdate              0:off      1:off      2:on      3:on      4:on      5:on      6:off


# ls -lrt /etc/init.d/ntp*
-rwxr-xr-x. 1 root root 1866 Oct 22  2009 /etc/init.d/ntpdate
-rwxr-xr-x. 1 root root 1923 Oct 22  2009 /etc/init.d/ntpd


Also I can start ntpdate without starting ntpd


# service ntpd status
ntpd is stopped
# service ntpdate start
ntpdate: Synchronizing with time server:                   [  OK  ]


0
farzanjCommented:
As I said, ntpdate can be done, or could be done till RHEL5 when ntpd was NOT running.  Could you actually run ntpdate when ntpd WAS running?
0
farzanjCommented:
Regarding your second point of ntpdate as a service, I think this discussion would answer your question.

http://forums.fedoraforum.org/archive/index.php/t-187610.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
farzanjCommented:
And as upanwar mentioned that you CAN run ntpdate with option -d.  Thanks upanwar.
0
savoneAuthor Commented:
@faranj

That link to fedoraforum.org is exactly what I needed to explain ntpdate as a service.

Now I have just one more question, how can I make it so ntpd will NOT answer queries for time on machines I want to only be clients?
0
farzanjCommented:
Use restrict in ntp.conf
restrict default ignore

OR specifically by
restrict 202.54.1.5 mask 255.255.255.245 nomodify notrap noquery


For full details, following this link

http://www.cyberciti.biz/faq/rhel-fedora-centos-configure-ntp-client-server/
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.