Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 22nd March 2012, 11:05 PM
rholme Offline
Registered User
 
Join Date: May 2009
Posts: 83
linuxfirefox
time during boot WRONG - GMT???

I live in the Eastern US so my normal time zone is GMT +5, now on daylight savings so +4.

I have been having problems with httpd coming up from a script running in /etc/rc.d/rc.local.

The script runs but httpd does NOT start as it should.

In the process I have had a time stamp added to the script.

WHEN THE MACHINE BOOTS, IT BELIEVES IT IS ON GMT, BUT THEN IT FIGURES IT OUT.

I am not sure if this is part of the httpd problem, but it sure is weird.

The result of my "echo..... >>" command looks like:

/local/bin/S92httpd called with start at Thu Mar 22 17:51:09 EDT 2012
/local/bin/S92httpd called with start at Thu Mar 22 13:52:49 EDT 2012

I had just run the script a 5:21 manually; then rebooted getting the 4 hour earlier GMT time (showind as EDT)..

Is this behavior normal or is this some kind of fisable bug.
Reply With Quote
  #2  
Old 22nd March 2012, 11:34 PM
Iron_Mike's Avatar
Iron_Mike Offline
Registered User
 
Join Date: Jul 2005
Location: Ft Huachuca, AZ
Posts: 3,762
linuxfirefox
Re: time during boot WRONG - GMT???

Did you happen to select the NTP (Network Time Protocol) when you installed Fedora? If you did check it under "system settings" and try turning it off to see if it fixes the issue...
Reply With Quote
  #3  
Old 23rd March 2012, 01:00 PM
rholme Offline
Registered User
 
Join Date: May 2009
Posts: 83
linuxfirefox
Re: time during boot WRONG - GMT???

OK, that was it. Thanks. But for the record, changing this was not under system-settings - rather administratioin -> system-config-date. PS - it did not fix the httpd problem but at least the date is right. I can add a crontab entry to fix the date once in a while.

Thanks - weird.

---------- Post added at 08:00 AM ---------- Previous post was at 07:35 AM ----------

Well, I guess I spoke out of turn. /usr/sbin/ntpdate and ntpd are no longer there in fedora 16. I see rdate is but I tried 4 suggested servers for rdate (from google searches) - none respond. That is a shame. I will set my clock manually occasionally.
Reply With Quote
  #4  
Old 23rd March 2012, 01:11 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105
linuxfirefox
Re: time during boot WRONG - GMT???

The time zone setting doesn't get synchronized properly with httpd by systemd.

There may be no way to fix that. The TZ setting is supposed to be inherited by all processes that are started following... Unfortunately, systemd does not do that.

You MIGHT be able to kluge it by manually setting the TZ environment variable in the httpd script (before httpd server starts), or possibly by setting it in the "functions" script invoked by all the init.d scripts.

Last edited by jpollard; 23rd March 2012 at 01:14 PM.
Reply With Quote
  #5  
Old 23rd March 2012, 02:37 PM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,612
linuxfirefox
Re: time during boot WRONG - GMT???

Quote:
Originally Posted by rholme View Post
OK, that was it. Thanks. But for the record, changing this was not under system-settings - rather administratioin -> system-config-date. PS - it did not fix the httpd problem but at least the date is right. I can add a crontab entry to fix the date once in a while.

Thanks - weird.

---------- Post added at 08:00 AM ---------- Previous post was at 07:35 AM ----------

Well, I guess I spoke out of turn. /usr/sbin/ntpdate and ntpd are no longer there in fedora 16. I see rdate is but I tried 4 suggested servers for rdate (from google searches) - none respond. That is a shame. I will set my clock manually occasionally.

Fedora 16 switched to using chrony instead of ntpdate or ntpd. If you check the box in your time/date settings and set network time on, then it should update your clock on each boot, and on a regular interval while the system is running.
Reply With Quote
  #6  
Old 23rd March 2012, 02:49 PM
rholme Offline
Registered User
 
Join Date: May 2009
Posts: 83
linuxfirefox
Re: time during boot WRONG - GMT???

Yep, but if I do that - the time is wrong until the machine is booted. See original post. Thanks anyway.

My problem with rdate as an alternative is opening up port 37 on my external firewall. I guess I need a new router - until I get one nothing can be changed.
Reply With Quote
  #7  
Old 23rd March 2012, 02:54 PM
PabloTwo's Avatar
PabloTwo Online
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,126
linuxfirefox
Re: time during boot WRONG - GMT???

It sounds to me like perhaps your hardware clock (the one on the motherboard and kept alive by CMOS backup battery) is set to UTC. You can check it this way.
Code:
date
sudo hwclock --show
The "date" command displays your "system" time, which is probably your local time. If you find that your hardware clock is on UTC and you would like to set it to your local time, you could do it this way.
Code:
yum install ntpdate
ntpdate us.pool.ntp.org
hwclock --systohc
Running the ntpdate command just sets your system time to the correct time, before running the hwclock command to set the hardware clock to the same time as the system time. I just went through this procedure yesterday on my lappy which I boot into runlevel 3, and noticed "date" command was about an hour behind (must have missed the time change to Daylight Savings). I corrected the time with the ntpdate command and thought that was fixed. On my next boot, the date command was still an hour behind. That's when I learned about using the hwclock command. Now my lappy boots to the correct time in runlevel 3.
Reply With Quote
  #8  
Old 23rd March 2012, 03:08 PM
DBelton's Avatar
DBelton Offline
Administrator
 
Join Date: Aug 2009
Posts: 6,612
linuxfirefox
Re: time during boot WRONG - GMT???

hwclock used to run on each shutdown to write the system clock back to the hardware clock, but I noticed that one of the systemd updates changed that. This was due to the change to using chrony, I believe. Chrony keeps it's own drift and slew data, and synching the clock back on every shutdown makes that data wrong.

Now, to me, it would be better to sync it back to the hardware clock on shutdown and reset the drift data, but chrony was more designed for machines that are up for months at a time, I believe.

hwclock does run on each boot to set the system clock from the hardware clock, and any other apps like ntpd or chrony need to run after hwclock is run. Chrony, when started takes the system clock, that was just loaded from the hwclock, applies its drift/slew data to correct the time and then goes on about it's business, occasionally checking the time from ntp servers to update it's data and making corrections as needed.

And yes, I got bit by the same thing a few months back when somehow my hardware clock got exactly 12 hours off. Chrony hid the problem, making it harder for me to figure out. I kept getting errors on boot that the timestamp on my filesystem was in the future because the filesystem check ran before chrony adjusted my time back to being correct. Running the command pablotwo stated above reset my hardware clock to being correct, and no errors after that.

Last edited by DBelton; 23rd March 2012 at 03:16 PM.
Reply With Quote
  #9  
Old 23rd March 2012, 03:24 PM
rholme Offline
Registered User
 
Join Date: May 2009
Posts: 83
linuxfirefox
Re: time during boot WRONG - GMT???

hmmmm - I yum installed ntpdate and now run it in the crontab once a week. the hwclock --show command shows things right before and after. I guess I will leave the system-set-network date off and do this. I guess I am set now.

Thanks to all.
Reply With Quote
  #10  
Old 23rd March 2012, 03:34 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,105
linuxfirefox
Re: time during boot WRONG - GMT???

The only thing going wrong is the local time.

The actual time has always been correct. This points to the loss of the configuration for local time - and that is up to when systemd sets/updates/whatever that value.

Everything I've seen so far has indicated that being done after the httpd server is started - which means httpd gets GMT as the local time instead of eastern daylight saving time.
Reply With Quote
Reply

Tags
boot, gmt, time, wrong

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unwanted (wrong) time change michele EOL (End Of Life) Versions 5 11th February 2010 06:42 PM
Time on the forums is wrong? SHtRO Fedora Focus 3 27th April 2006 06:40 AM
Time on web server wrong standbyone Servers & Networking 4 2nd January 2006 11:48 PM
Up2date icon: You are at wrong place at the wrong time. tonytiger Using Fedora 2 28th May 2005 11:39 AM


Current GMT-time: 14:18 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat