An epiphany for the UNIX/Linux style!

Source: Internet
Author: User

After reading Hawkins's blog, I mentioned how to correct the time to the local time in Fedora Core 6, and I also checked how ubuntu was set,
Suddenly realized the relationship between system programs, system startup scripts, and configuration files, a typical * nix style.

(1) shell script (system startup script) to be executed during system startup, such as/etc/init. d/hwclock. Sh
(2) This shell script imports a file in/etc as the configuration information, that is, the configuration file, for example,/etc/default/RCS.
(3) Whether the program is actually executed is a system program called in shell script, such as/sbin/hwclock.

The specific annotations are as follows:


Hwclocksh ()
{
[! -X/sbin/hwclock] & Return 0
./Etc/default/RCS <--- the variables in the configuration file are imported here.

./Lib/LSB/init-Functions

["$ GMT" = "-U"] & UTC = "yes"
Case "$ UTC" in
No | "") GMT = "-- localtime" <-- it is shown that if UTC is no, local time is enabled.
UTC = ""
;;
Yes) GMT = "-- UTC"
UTC = "-- UTC"
;;
*) Return 1 ;;
Esac

###... The middle part is omitted ...###

If ["$ hwclockaccess "! = No]; then
# Copies hardware clock time to system clock using the correct
# Timezone for hardware clocks in local time, and sets Kernel
# Timezone. Do not remove.
/Sbin/hwclock -- hctosys $ GMT $ hwclockpars $ badyear <-- the real body of the running settings

Therefore, to enable the local time in Ubuntu, you must modify/etc/default/RCs as follows:

# Comment out the original setting: UTC = Yes
# Change to the following content...
UTC = No

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.