Koozali.org formerly Contribs.org

Other Languages => Italiano => Topic started by: Mat78 on January 18, 2019, 09:34:20 AM

Title: Data e ora server sbagliate
Post by: Mat78 on January 18, 2019, 09:34:20 AM
Buongiorno a tutti,
questa mattina ho notato sul mio server che l'ora è sbagliata, l'orologio del sistema (anche se sincronizzato con i time server) segnala le 8:53 mentre sono le 9:33.

Per caso qualcuno ha avuto lo stesso problema e sa come possa essere risolto?

Grazie in anticipo

Title: Re: Data e ora server sbagliate
Post by: mmccarn on January 18, 2019, 01:10:23 PM
Google translation of this topic (english to italian):

NTP stops syncing (by default) if your system clock is more than 1000 seconds off from the servers you're syncing with.

If that happens, you need to reset the system clock manually.  This command will usually do that:
Code: [Select]
ntpdate -u pool.ntp.org

Once your system time is approximately correct, you can check the ntp status using "ntpq".  The entry marked with "*" is the server currently being used by my system:
Code: [Select]
# ntpq -pn
     remote           refid      st t when poll reach   delay   offset  jitter
*     2 u  140 1024  377   64.726    0.647  13.222
+      2 u  456 1024  377    9.291    0.780   4.991
+    2 u  670 1024  377   29.494   -2.097   0.753
-      3 u  508 1024  371   72.938    2.256   5.367     .LOCL.          10 l  20d   64    0    0.000    0.000   0.000

Some things that can cause your system time to get out of sync (in case it happens again):

- Virtual servers used to require some special settings for ntpd (I don't know if this is still a problem):

- The server's hardware clock may be acting up, or may no longer be supported by Centos 6

- A bad motherboard battery can sometimes cause a physical server to boot with the wrong time when rebooted (my last server hardware had this problem, so I created a cron job to run '@reboot' to run ntpdate and set the server's time)
Title: Re: Data e ora server sbagliate
Post by: Mat78 on February 25, 2019, 06:06:13 PM
Grazie per la risposta, sono riuscito a fare qualche test solo ora.

Ho provato a seguire il tuo suggerimento ma il server risponde con l'errore "ntpdate[6616]: no server suitable for synchronization found" anche provando ad usare server diversi, ma il risultato è sempre lo stesso.

Ho provato a guardare su internet, ho visto che nel 2014 c'era già stato un problema simile, che però oggi dovrebbe essere risolto.

Per adesso ho risolto impostando manualmente l'orario.

Qualcuno ha qualche altro suggerimento?

Ancora grazie
Title: Re: Data e ora server sbagliate
Post by: mmccarn on February 26, 2019, 02:27:56 PM
(translate this post from Italian back into English)

"man ntpd" on my SME 9.2 system says "ntpd -q" can be used instead of "ntpdate"

To use "ntpd -q" you need to stop the ntpd service:
Code: [Select]
# stop the running ntpd service
sv d ntpd

# run ntpd manually, set the time and exit (-q) ignoring the current offset (-g)
#   add -d to include debugging information (-d) in the output (ntpd -q -g -d)
ntpd -q -g

# restart the ntpd service
sv u ntpd

Some thoughts on why ntpdate might not have worked:

Were you using "ntpdate -u", or only "ntpdate"? I used to get the error you describe ("no server suitable for synchronization found") if I ran ntpdate without the "-u" argument.

According to https://www.pool.ntp.org/zone/it, a good NTP for you might be it.pool.ntp.org:
Code: [Select]
ntpdate -u it.pool.ntp.org
Both ntpdate and ntpd -q will fail if your network firewall is blocking outbound UDP traffic on port 123.
Title: Re: Data e ora server sbagliate
Post by: Mat78 on June 19, 2019, 09:13:25 AM
Grazie, alla fine ho scoperto che il problema era proprio il firewall che bloccava la porta 123, una volta aperta questa porta tutto ha ripreso a funzionare alla perfezione.