Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

ntpdate... Posle restarta, vreme pogrešno za 1h

[es] :: Linux/UNIX serveri i servisi :: ntpdate... Posle restarta, vreme pogrešno za 1h

[ Pregleda: 1685 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

pisac

Član broj: 13046
Poruke: 4578



+3341 Profil

icon ntpdate... Posle restarta, vreme pogrešno za 1h26.01.2011. u 07:36 - pre 161 meseci
Posle svakog hard-reseta jednog slackware servera, vreme u sistemu (u svim logovima) mi je pomereno tačno za 1h napred. Pošto server automatski radi ntpdate čim se spoji na Internet, to se popravi vrlo brzo. Ali me ipak nervira sam taj zapis u logovima koji nema tačno vreme.

Zašto se to dešava, i kako to rešiti?

Inače, restart se radi svake noći u isto vreme, grubom metodom (strujni tajmer), iz određenih razloga koji nisu bitni za temu.
 
Odgovor na temu

Tyler Durden
Tyler Durden
Beograd

Član broj: 4312
Poruke: 3379
*.verat.net.



+1365 Profil

icon Re: ntpdate... Posle restarta, vreme pogrešno za 1h26.01.2011. u 08:07 - pre 161 meseci
Vjerovatno hardverski sat nije tacno podesen (onaj u BIOS-u).
Beneath civilization's fragile crust, cold chaos churns...
 
Odgovor na temu

jablan

Član broj: 8286
Poruke: 4541



+711 Profil

icon Re: ntpdate... Posle restarta, vreme pogrešno za 1h26.01.2011. u 08:10 - pre 161 meseci
Preneto odavde:

Citat:
Setting the hardware clock

To set the hardware clock, my favourite way is to set the system clock first, and then set the hardware clock to the current system clock by typing ``/sbin/hwclock --systohc'' (or ``/sbin/hwclock --systohc --utc'' if you are keeping the hardware clock in UTC). To see what the hardware clock is currently set to, run hwclock with no arguments. If the hardware clock is in UTC and you want to see the local equivalent, type ``/sbin/hwclock --utc''


Tebi treba varijanta bez UTC.

Malo sam gledao, verovatno se razlikuje od distribucije do distribucije, na Ubuntu imaš fajl /etc/default/rcS u kome stoji:

Code:


#
# /etc/default/rcS
#
# Default settings for the scripts in /etc/rcS.d/
#
# For information about these variables see the rcS(5) manual page.
#
# This file belongs to the "initscripts" package.

TMPTIME=0
SULOGIN=no
DELAYLOGIN=no
UTC=no
VERBOSE=no
FSCKFIX=no


Ovo gore UTC=no znači da se vreme u hardverskom satu čuva u lokalnoj, a ne u UTC zoni.
 
Odgovor na temu

pisac

Član broj: 13046
Poruke: 4578



+3341 Profil

icon Re: ntpdate... Posle restarta, vreme pogrešno za 1h26.01.2011. u 09:10 - pre 161 meseci
Kad uradim hwclock dobijem: Wed 26 Jan 2011 11:05:51 AM CET -0.767457 seconds

UPDATE: Hehe, ne znam gde mi je bila glava malopre, vreme ne da nije korektno nego je čitav sat naped

[Ovu poruku je menjao pisac dana 26.01.2011. u 11:08 GMT+1]
 
Odgovor na temu

Srđan Pavlović
Specijalna Edukacija i Rehabilitacija MNRO
Vojvodina, Bačka Palanka

Član broj: 139340
Poruke: 5571
77.46.145.*

Sajt: www.oligofrenolog.com


+382 Profil

icon Re: ntpdate... Posle restarta, vreme pogrešno za 1h26.01.2011. u 10:04 - pre 161 meseci
Probaj

hwclock --systohc


I, jel imas neto u

/etc/timezone

?

Evo, ovde nesto oko toga:

Citat:

>> hwclock --systohc

>> will sync your hardware clock to the system clock

> my HW clock is set to UTC; if i set correctly my sys clock, will 'hwclock
> --systohc' set the HW clock taking into account the delay due to timezone?

Add an extra "-u" (clock already in UTC) to the hwclock commandline
given above.

> or will it just copy the sys clock to HW one?

Without the -u it will convert UTC "system clock" to localtime and put
THAT into the hardware clock, with the -u it knows that both system
clock and hardware clock are in UTC, so no conversions needed.

See also the hwclock entries in /etc/rc.d/rc.S (for reading the hwclock
at bootup) and /etc/rc.d/rc.6 (for rewriting it from the system clock at
shutdown).
Although they nowadays use the "long form" of the option (--utc).

> anyway, first i need to solve to problem of DST;
> my sys hasn't moved to DST whuile the HW clock is set to UTC.

Neither the hardware clock nor system time SHOULD move, just your local
representation (localtime) OF it.

 
Odgovor na temu

pisac

Član broj: 13046
Poruke: 4578



+3341 Profil

icon Re: ntpdate... Posle restarta, vreme pogrešno za 1h26.01.2011. u 10:42 - pre 161 meseci
Ma izgleda da je bilo sa tim hardverskim satom. Sada sam odradio hwclock --systohc --localtime, pa ćemo videti sutra da li je problem rešen.
 
Odgovor na temu

pisac

Član broj: 13046
Poruke: 4578



+3341 Profil

icon Re: ntpdate... Posle restarta, vreme pogrešno za 1h27.01.2011. u 10:03 - pre 161 meseci
Da, to je bilo to. Problem rešen.
 
Odgovor na temu

[es] :: Linux/UNIX serveri i servisi :: ntpdate... Posle restarta, vreme pogrešno za 1h

[ Pregleda: 1685 | Odgovora: 6 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.