LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-17-2003, 12:10 PM   #1
zozoonabike
LQ Newbie
 
Registered: Sep 2003
Location: San Diego
Distribution: Red Hat 9.0
Posts: 7

Rep: Reputation: 0
NTP and Timezon


Hello,

I tried to set up a NTP server on my server and to use it from my laptop (which is client on the network). But it didn't work...
So I wanted to set back my clock with no NTP server with the redhat-config-date command. I did it, telling that my timezone was Pacific Time (Americana/Tijuana) and I validate. But since then I am always in UTC time and there is no way for me to go back to the Pacific Time... What's going on ?
I even checked the /etc/sysconfig/clock file and it seems to be correct...
What can I do ?

Thanks,

Olivier
 
Old 10-22-2003, 07:10 AM   #2
clacour
Member
 
Registered: Sep 2003
Location: Dallas, Tx, USA
Distribution: Red Hat, Gentoo, Libranet
Posts: 98

Rep: Reputation: 16
Try redhat-config-date again, click on timezone and look down at the bottom left. There's a checkbox that says your system is/is not on UTC time.

From the description of your problem, whichever one it is (on or off), flip it to the other one. (You might have to reset your time after you do that.)

Linux will keep time in the hardware clock either in UTC (aka Greenwich, aka Zulu) time, or local time (your timezone).

If the software thinks it's in local time, it won't apply a timezone correction (7 hours, I believe, in your case), because the hardware clock already has that factored in. If, in fact, your hardware clock is in UTC time, everything's going to be 7 hours off.

It's basically a mismatch between the stuff that says which flavor time to store in the hardware clock, and the stuff that tries to display it.

You can use the "hwclock" command to see what time the hardware clock is set to.

The config file that tells it which version to use is /etc/sysconfig/clock.

Hope this helps,

CHL
 
Old 10-22-2003, 01:59 PM   #3
zozoonabike
LQ Newbie
 
Registered: Sep 2003
Location: San Diego
Distribution: Red Hat 9.0
Posts: 7

Original Poster
Rep: Reputation: 0
Hello Clacour...

Thanks for the advice.
I tried the hwclock and I saw that my system clock was UTC.
So I ran once again redhat-config-date and tried with to change the check box (actually I checked it since it was unchecked) but it doesn't change anything. When in a terminal I do a "date" I still have my clock in UTC time.
But when I do an su (or log root) the "date" command respond with a PCT...
I noticed something weird : when I tried to check the services launched to check if the ntpd is running (I launch redhat-config-services) and I go on this particular service (ntp) then my CPU start working like crazy and I have to stop the service application... There is really something weird with this ntp stuff...

Olivier
 
Old 10-22-2003, 08:22 PM   #4
clacour
Member
 
Registered: Sep 2003
Location: Dallas, Tx, USA
Distribution: Red Hat, Gentoo, Libranet
Posts: 98

Rep: Reputation: 16
As I mentioned, you might need to reset the time after you've flipped that bit. Also, this is one of the few cases where it might be a good idea to reboot the machine. I'm not sure where in the boot process the system forms its ideas of how time works, so I can't tell you specifically what to do to make sure it has everything in sync. If this is a dual-boot Linux/Windows system, definitely use local time and do NOT use UTC. Windows doesn't understand UTC at all.

I can probably help with the NTP stuff, if you like. It's actually pretty straightforward, once you know how it works.

For starters, try the command "ntpdate pool.ntp.org". (Make sure ntpd is not running first. Ntpd and ntpdate won't share.) That should set your system to the current time, according to the UTC and timezone settings. (Do this after the reboot I mentioned. Changing the file in /etc/sysconfig/clock doesn't do anything directly.) That should set your time to the world standard.

If you want to do ntp from both the server you mentioned and the laptop, post the /etc/ntp.conf files for both systems. Basically, anything that's running ntpd can be an ntp server. The only gotcha is that it needs to succeed in connecting to the ntp network itself.
 
Old 10-23-2003, 04:40 PM   #5
zozoonabike
LQ Newbie
 
Registered: Sep 2003
Location: San Diego
Distribution: Red Hat 9.0
Posts: 7

Original Poster
Rep: Reputation: 0
How do I put the hardware clock in local time and not in UTC ?
I tried the command hwclock --localtime --set XXXXXX and my hardware clock is still in UTC...
Thanks,
Olivier
 
Old 10-24-2003, 08:29 PM   #6
clacour
Member
 
Registered: Sep 2003
Location: Dallas, Tx, USA
Distribution: Red Hat, Gentoo, Libranet
Posts: 98

Rep: Reputation: 16
Use redhat-config-date to set the time, and to uncheck the "UTC" box.

Double-check that /etc/sysconfig/clock says "local" or something like that (anything but "UTC", basically).

Say "hwclock --systohc"

Reboot the system to make sure all the pieces have the same idea. (If you/I knew the clock system better, this step wouldn't be necessary, but if the correct time survives a reboot, you can be pretty sure it's right now.)

You can also use the "date" command to set the clock:

"date 10242027" would set the system time to Oct 24, 2003, 20:27 (aka 8:37PM).

redhat-config-date should use the "date" command internally, but if for whatever reason, it's wrong when you get out of the window, you can use the command-line command "date" instead.

Use the "hwclock --systohc" after you have the time right. (Check it by saying "date" with no options.)
 
Old 10-24-2003, 09:30 PM   #7
zozoonabike
LQ Newbie
 
Registered: Sep 2003
Location: San Diego
Distribution: Red Hat 9.0
Posts: 7

Original Poster
Rep: Reputation: 0
It's crazy !!!
So I have done exactly what you said. And the result is :
When I am root, everything is cool, I am with the right time and right timezone.
But when I am not root (regular user) I am still in UTC. If I do the date command (or the redhat-config-date) I have to be root and the date is set propely. I event try to reset it but it doesn't change anything when back to regular user.
For the sysclock, I did the hwclock --systohc command, then a hwclock to check everything is fine... Everything was find. I did reboot and back from the reboot, my hwclock was back to UTC...
So my hwclock is UTC and my user clock is also UTC but not at the same hour : that's terrific !
I even tried to have a look at the BIOS time and it was fine... (I couldn't check the timezone since you have no opportunity to change that)...
Well if you have any other idea, but don't worry if you don't I will by a big clock to put on my desk :-(
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with NTP again please!! MaverickApollo Linux - General 2 05-30-2006 07:33 AM
help with NTP stevenhasty Slackware 6 02-16-2005 11:04 AM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 02:04 PM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 02:22 PM
NTP Help MaverickApollo Linux - Software 0 10-28-2003 08:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration