Author Topic: Need linux help with clock  (Read 624 times)

Vodka7

  • friend
  • Senior Member
  • ***
  • Posts: 1,067
Need linux help with clock
« on: August 05, 2009, 04:42:24 PM »
Hey all,

Earlier I mentioned I was running Gentoo, which apparently was a lie.  I was running Sabayon, which is more like Gentoo with a bunch of crap that destroys your system randomly bolted on.  (Well, destroys is an exaggeration, but before installing Gentoo I would have had no idea how to chroot in.  Apparently using the gnome Add Users tool in Sabayon changes your root and user passwords?)

Anyway, now I'm actually running Gentoo, which taught me more in two days of installing than months of Ubuntu or a week of Sabayon did.  I've recompiled my kernel (like ten times, *sigh*, apparently enabling Virtualization in the kernel means destroying VirtualBox, and also apparently running genkernel really isn't a good idea), I compiled OpenOffice from the source, I got X, GNOME, compiz, emeralds, and AVN running, and in short, my system is now working 100% exactly the way I want it to.

I did all of that with only basic Linux knowledge and a search engine.  I didn't post on the Gentoo forums, or ask on IRC.  I didn't want any easy fixes, since the whole point was to build the system from scratch for myself so I'd really understand how it worked.  I got everything running in the end.

EXCEPT FOR THIS GOSHDARNED MONKEY FIGHTING CLOCK.

I cannot get this thing working past a reboot to save my life.

I've tried just about everything, so I don't know exactly how it's set up right now....  Last thing I remember doing was setting up a symlink to something or other, and editing something to keep the clock in UTC.  It was fine before I rebooted.  Now it's off by four hours and ten minutes.

I also can't seem to disable net.eth0 during boot (I use net.wlan0, which works fine (after several kernel compiles and a whole lot of reading)).  It's not a big deal, just adds maybe 30 useless seconds to my boot time.

Anyway, if anyone can help, I'd really appreciate it.  I can post whatever you need.

BrokenPaw

  • friends
  • Senior Member
  • ***
  • Posts: 1,674
  • Sedit qvi timvit ne non svccederet.
    • ShadowGrove Interpath Ministry
Re: Need linux help with clock
« Reply #1 on: August 05, 2009, 05:00:04 PM »
First guess:

Sounds like your system's hardware clock is incorrect.  When you set the kernel clock using the 'date' command, all it does is set the kernel's clock; it doesn't push that setting down to the system's hardware clock.

Once you set the internal clock with date, then (as root) run:

hwclock --systohc

This will set the hardware clock to the current system time.

-BP
Seek out wisdom in books, rare manuscripts, and cryptic poems if you will, but seek it also in simple stones and fragile herbs and in the cries of wild birds. Listen to the song of the wind and the roar of water if you would discover magic, for it is here that the old secrets are still preserved.

Vodka7

  • friend
  • Senior Member
  • ***
  • Posts: 1,067
Re: Need linux help with clock
« Reply #2 on: August 05, 2009, 05:08:28 PM »
Ooh, thanks for the quick reply.  Tried it, looks good so far, date returns what it should.  I'll reboot once my compiler finishes at let you know the results.

Vodka7

  • friend
  • Senior Member
  • ***
  • Posts: 1,067
Re: Need linux help with clock
« Reply #3 on: August 05, 2009, 06:22:52 PM »
Didn't work, but I got it going in my own.

I had CLOCK="UTC" in /etc/conf.d/clock, but it should have been CLOCK="local".  I vaguely remember something in the Gentoo handbook saying it was better to keep the clock in UTC and manage the timezone another way, but honestly, I give up at this point.  Just want my clock to say the right time, which it finally does :)

Thanks for the help.