Link to home
Create AccountLog in
Avatar of ikhmer
ikhmer

asked on

NTP and Daylight Time Saving problem

Dear Experts,

I'm required to configure NTP Time server on Sun Solaris 5.8 and from other Sun server need to synchonize with this server. I already done on NTP Server
and as well as at NTP client side, but the problem is some Client is one hour behind, some is 7 hours behind...

when i check the client which 7hours behind i found that the timezone is not correct, but although i change the timezone and try to reach NTP Server by command
"ntpdate ip-ntp-server" it seem not effect at all. my question is do i need to restart the server after change timezone or what is the service that i could just stop and restart?

for client which is 1h later is may be because of daylight saveing is on/off.., my question is how can i check to see it is on or off? what is the command to set daylight saving on/off?
do i need to restart after issue these command?

and regarding to daylight timesaving do you recomment to turn on or turn off??? what is it benifit or risky? note: those sun server is running live oracle database..., i don't want to
restart if possible... please, give me the good way!!!

Very appreciate for your quick response!!!

Best Regards,
iKhmer
Avatar of Tintin
Tintin

How did you change the timezone?  Timezone settings are what determines daylight saving dates.  Shifts for start/end of daylight savings is done automatically (assuming you have a correct timezone set)
>>my question is do i need to restart the server after change timezone or what is the service that i could just stop and restart?

You need to edit /etc/TIMEZONE  to change the TIMEZONE,
then  reboot your server after change the TIMEZONE

Avatar of ikhmer

ASKER

thanks all,

and what is the command to see Daylight saving is on or off? what is the command to turn off or on?
in real world do you recomment to turn on or off?

thanks,

ikhmer
There's no command to turn daying savings time on or off if the timezone you are running in has daylight saving.  

Are you worried about Oracle databases when the time goes back?  If so, then, there's no real reason to worry.  I've worked in many, many Oracle sites and there's never, ever been a problem with clocks going back/forward during daylight savings time.

See  /usr/share/lib/zoneinfo/src/README for more info on timezones and daylight savings.

One thing to keep in mind is that all Unix vendors issue patches when ever a particular time zone has daylight savings changes.
Avatar of ikhmer

ASKER

the problem is we are going to move one hour farward at the end of this month!.. and i'm trying to configure NTP on one server,
and when i try to synchronize from the clients some are ok! but some 1 hour late and there is one server(ntp-client) got 7hour difference.. when i check
the 7hour dif svr i found it because of timezone is not the same!!!

The problem left is with some server which is alway 1h later then NTP Svr..., I think it may cause by day light saving turn on or off because timezone and is correct and the ntp client
and talk to ntp -server... one more thing when i testing to syncronize from my windows client it is 1h before NTP server, but when i turn off the DaylightSaving option it is correct...

So, my idea is it could because of daylight saving turn on of off-- but i don't know whr to check in Solaris... and how can i change it :-(
Avatar of ikhmer

ASKER

anyone help to make me clear on these?
Remember that on Unix/Linux systems, all time is internally kept as UTC.  The date/time you actually use is simply determined by your timezone setting.  NTP doesn't have anything to do with changing the time of your timezone, it is simply keeping the system clock in sync.

So on your server that is 7 hours different, if the timezone is different, then of course it's going to display a different time.

Are all your servers in the same timezone?

The only way you can really turn daylight savings off on a Unix server is to use a timezone that has no daylight savings.  Some organisations that have servers spread all around the world choose to run all their systems on UTC, so they have a consistent date/time on all their systems and don't have to worry about the differences in timezones.
Avatar of ikhmer

ASKER

I already change to the same timezone of all servers!

just want to make sure if there is no command to turn on or off daylight saving?

thanks,



Just to reiterate, there is *no* command to turn daylight savings on/off.
after changing the timezone file in /usr/share/zoneinfo, you need to "compile" it, with "zic", for example "zic /usr/share/zoneinfo/asia" , this will enable the changes in it, no need to reboot.
Additional comment:  "ntpdate" usually does not work when the NTP client is running.    Stop NTP, then issue "ntpdate".   restart ntp when you're ready.
ntp has nothing to do with daylight saving times or time zones
Your ntp client compares the time it gets from the server with its "system time". That system time is set on boot from CMOS and probably adjusted using a TZ (timezone) environment variable.
So all DST things go into the TZ environment variable. Simple, isn't it?

DST is a virtual thing, just reality for humans ;-)
if you don't want to use daylight at all, you can change the TIMEZONE to use: GMT-N

ls  /usr/share/lib/zoneinfo  for more details.
Avatar of ikhmer

ASKER

>>if you don't want to use daylight at all, you can change the TIMEZONE to use: GMT-N
is use to adjust the time clock base on local area/country, how can you know system doesn't use dayligh saving?

>>zic /usr/share/zoneinfo/Asia
i try with above command but i got the message back like "Asia", line 1: line too long
why do you want to use zic?

If you don't specified local area/country, the system will not be able to figure out, there is daylight saving or not.

eg:
GMT+8
could be Perth, Sigapore, HongKong, Beijing....etc!

Avatar of ikhmer

ASKER

suppose the system is already configured GMP+8, do u mean if i remove this line in etc/TIMEZONE will the daylight saving is inactive?

And i try to use zic command base on above post that tell me how to make the system effective after change timezone without reboot the server!

thanks
modify TZ value in /etc/TIMEZONE file,

eg:

TZ=Australia/West
to
TZ=GMT-8

that way you will have your local time and no daylight saving.
Avatar of ikhmer

ASKER

Ok, thank i did like that...! and i try to test in one server(ntp-client) which is 1h later then ntp-server by rebooting... after rebooting it work and synchronize well

-so, it work unless i reboot if can't use zic to start service after change timezone (TZ=GMT+N)....

-Refer to command " ntpdate ip-address"  when i issue this command i still got message "ntpdate[28378]: the NTP socket is in use, exiting" although i stoped xntpd service, why?

-and other issue, when after i reboot ntp-server all the ntp-client doesn't not connect back that server..although i stop and start xntpd : but it work untill i reboot those ntp-server too
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of ikhmer

ASKER

Thanks alot, and i have an other question: is TG=GSM+3 follow Egypt, it is setted in NTP-Server on Solaris and
when i install Nettime which download from internet to install on window for synchronization , the time is 6 to 7h difference., in that case should i use TG=GSM-3 in Solaris? or it cause by what!

TG? do you mean TZ?
The timezone for Egypt is:

GMT+3

for daylight savings time

and

GMT+2

for non-daylight savings time.
GMT* is never a DST timezone, but an absolute timezone. You have to use the named ones, like MESZ, PST, etc.
Just to avoid more confusion how it behaves.