setclock.xml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <sect1 id="ch07-setclock">
  2. <title>Configuring the setclock script</title>
  3. <?dbhtml filename="setclock.html" dir="chapter07"?>
  4. <para>The setclock script is only for real use when the hardware clock (also
  5. known as BIOS or CMOS clock) isn't set to GMT time. The recommended
  6. setup is setting the hardware clock to GMT and having the time converted
  7. to localtime using the /etc/localtime symbolic link. But if an
  8. OS is run that doesn't understand a clock set to GMT (most notable are
  9. Microsoft OS'es) you may want to set the clock to localtime so that
  10. the time is properly displayed on those OS'es. This script will then
  11. set the kernel time to the hardware clock without converting the time using
  12. the /etc/localtime symlink.</para>
  13. <para>If you want to use this script on your system even if the
  14. hardware clock is set to GMT, then the UTC variable below has to be
  15. changed to the value of <emphasis>1</emphasis>.</para>
  16. <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
  17. the following:</para>
  18. <para><screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"</userinput>
  19. # Begin /etc/sysconfig/clock
  20. UTC=0
  21. # End /etc/sysconfig/clock
  22. <userinput>EOF</userinput></screen></para>
  23. <para>Now, you may want to take a look at a very good hint explaining how we
  24. deal with time on LFS at <ulink
  25. url="&hints-root;time.txt">&hints-root;time.txt</ulink>.
  26. It explains issues such as timezones, UTC, and the TZ environment
  27. variable.</para>
  28. </sect1>