setclock.xml 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. <sect1 id="ch07-setclock">
  2. <title>Configuring the setclock script</title>
  3. <?dbhtml filename="setclock.html" dir="chapter07"?>
  4. <para>This setclock script reads the time from your hardware clock (also
  5. known as BIOS or CMOS clock) and either converts that time to localtime
  6. using the <filename>/etc/localtime</filename> file (if the hardware clock
  7. is set to GMT) or not (if the hardware clock is already set to localtime).
  8. There is no way to auto-detect whether the hardware clock is set to GMT or
  9. not, so we need to configure that here ourselves.</para>
  10. <para>Change the value of the <emphasis>UTC</emphasis> variable below to a
  11. <emphasis>0</emphasis> (zero) if your hardware clock is not set to GMT
  12. time.</para>
  13. <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
  14. the following:</para>
  15. <para><screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"</userinput>
  16. # Begin /etc/sysconfig/clock
  17. UTC=1
  18. # End /etc/sysconfig/clock
  19. <userinput>EOF</userinput></screen></para>
  20. <para>Now, you may want to take a look at a very good hint explaining how we
  21. deal with time on LFS at <ulink url="&hints-root;time.txt"/>.
  22. It explains issues such as timezones, UTC, and the TZ environment
  23. variable.</para>
  24. </sect1>