1829748 Members
4015 Online
109992 Solutions
New Discussion

NTP client question

 
SOLVED
Go to solution
R.O.
Esteemed Contributor

NTP client question

Hi,

I configured a system as a ntp client. It is necessary to execute the command "ntpdate ", or when I start xntpd it automatically synchronizes the time ?
I want to do the synchronization slowly, not in one step, ¿How can do it?

Regards
"When you look into an abyss, the abyss also looks into you"
7 REPLIES 7
Fred Ruffet
Honored Contributor

Re: NTP client question

ntpdate will do it "one shot".
ntpd will slowly synchronize.

ntpdate at service startup should be a good thing, cause if offset is too big, xntpd won't synchronize. Script to start xnptd on /sbin/init.d should usr ntpdate first.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
R.O.
Esteemed Contributor

Re: NTP client question

So, what is the procedure?
- configure the ntp client
- start xntpd in the client??

Does this synchronize slowly the time in the client?

Regards,
"When you look into an abyss, the abyss also looks into you"
Mauro Gatti
Valued Contributor

Re: NTP client question

Check first if time difference between client an server isn't to high (less equal 1h) then start xntpd on client and... wait!
Try using ntpq -p on client system to check if client system is sycrnonized or still syncronizing.
If system is syncronized you would see a leading "*" on line where client is syncronized

root@leo [/]
# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
ntp1.ien.it 0.0.0.0 16 - - 1024 0 0.00 0.000 16000.0
ntp2.ien.it 0.0.0.0 16 - - 1024 0 0.00 0.000 16000.0
*virgo.pippo ntp2.ien.it 2 u 23 64 377 0.53 -4.910 0.34
LOCAL(0) LOCAL(0) 10 l 14 64 377 0.00 0.000 10.01
+virgo.pippo ntp2.ien.it 2 u 11 64 377 0.43 -4.841 0.82
Ubi maior, minor cessat!
Rick Garland
Honored Contributor

Re: NTP client question

You need to make sure that in /etc/rc.config.d/netdaemons you have the XNTPD=1 setting. Must be set to 1 for NTP to run.

Have the /etc/ntp.conf file modified to the settings for your environment. This can be as simple or as complex as need be. At the very least you should have 1 line that specifies the ntp server.

Start the ntp daemon
/sbin/init.d/xntpd start

Check
ntpq -p

RAC_1
Honored Contributor
Solution

Re: NTP client question

while ntpdate "ntp_server" does it right away, xntpd does it over the period of time.
you can do ntpdate "ntp_server" if you do not have apps/program that very time dependant or can be shutdown for a while.

Also xntpd will exit, if offset is too large to adjust for ntp. You can check it with ntpq -p "server"

You can also use ntpdate -B command to adjust ot slowly. (this is turn uses time() call)

Anil
There is no substitute to HARDWORK
PVR
Valued Contributor

Re: NTP client question

Hi !

COnfigure the NTP Client by modifying /etc/ntp.conf file.

Ensure that you have set XNTPD=1 (/etc/rc.config.d/ntdamons) to start the deamon during system startup.

When the system boots up, the command npdate get executed.

If the offset is big, xntpd will take long time to synhronise. It is better to use ntpdate a this time. But before that ensure that you don't have any time sensiive critical applications, cron jobs etc.are running in the system.

Don't give up. Try till success...
C. Beerse_1
Regular Advisor

Re: NTP client question

Once more in other words,

`ntpdate` is there to set the time now. This is to be compared with setting the time with the `date` command. This actually sets the time, either by skipping or doubling time. This can cause cron-tab entries to not execute or execute double.

`ntp`, `ntpd`, `xntpd` (or what name it has) is the deamon to keep the time in sync, if possible up to milisecond level. This drifts to the time by stretching or squeezing the timesteps. Every minute (maybe even every second) is stepped on only once.

Most startup scripts (and even current xntpd implementations) start with a step as ntpdate does and then keep in sync by drifting.

btw: see http://www.pool.ntp.org/ for general public clocks.
make everything as simple as possible, not simpler (A.Einstein??)