← Back to team overview

ubuntuforums-unanswered team mailing list archive

Re: [Question #78337]: How does setting the hwclock work in Ubuntu?

 

Question #78337 on util-linux in ubuntu changed:
https://answers.edge.launchpad.net/ubuntu/+source/util-linux/+question/78337

    Status: Open => Answered

Scott James Remnant proposed the following answer:
As per the comment at the top of /etc/init.d/hwclock.sh, this script is
not run on *startup* in Ubuntu - the code still remains inside the
script because Debian do still run it on startup and deleting the code
would make merging harder.

Instead the kernel sets the system clock from the hardware clock on
initial startup; if the hardware clock was in local time instead of UTC,
the system clock is re-adjusted to UTC by the
/lib/udev/rules.d/85-hwclock.rules file

It is the init script that is called on shutdown, and calls
/sbin/hwclock --systohc - it's present in the /etc/rc0.d and /etc/rc6.d
directories as K25hwclock.sh


Note that this isn't done on the Live CD for obvious reasons

-- 
You received this question notification because you are a member of UF
Unanswered Posts Team, which is an answer contact for Ubuntu.