gentoo 下Local time zone must be set--see zic manual page解决办法

今天升级sys-libs/timezone-data 结果发现提示
Local time zone must be set--see zic manual page 信息

###======================================
$ cat /etc/timezone
Asia/Shanghai

###======================================
$ cat /etc/conf.d/hwclock
# Set CLOCK to "UTC" if your system clock is set to UTC (also known as
# Greenwich Mean Time). If your clock is set to the local time, then
# set CLOCK to "local". Note that if you dual boot with Windows, then
# you should set it to "local".
#clock="UTC"
clock="local"

# If you want to set the Hardware Clock to the current System Time
# during shutdown, then say "YES" here.
# You normally don't need to do this if you run a ntp daemon.
clock_systohc="NO"

# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here. Alpha users may wish to use --arc or --srm here.
clock_args=""

###======================================
~] $ ls /etc/localtime -lh 发现没有做链接,以前是
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7

Code Listing 1.1: Setting the timezone information

# ls /usr/share/zoneinfo
(Suppose you want to use GMT)
# cp /usr/share/zoneinfo/GMT /etc/localtime
所以更新的数据要拷过去,省事的话就ln -sv 算球了

~] $ ls /etc/localtime -lh
lrwxrwxrwx 1 root root 33 05-30 23:47 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai
###======================================


$ grep TZ /home/axlrose/.bash_profile
export TZ='Asia/Shanghai'
###======================================

 

ntpdate命令安装:emerge ntp
 
更新了gentoo后发现系统时间回到2000年1月1号了,再一看硬件时间也是这样。笔记本是2002年买的吧,不知道是不是BIOS电池快没电了, 反正笔记本隔段时间不用就有可能出现这种情况,开机时也显示Low Battery。总结一下如何把时间改回来,以备日后参考。

0. 用date看系统时间,用hwclock --show看硬件时间。

1. 先用ntpdate找一个时间服务器把系统时间调整回来。www.pool.ntp.org提供了很多时间服务器,当然也包括中国的。命令如下,
sudo ntpdate 0.cn.pool.ntp.org

2. 用hwclock把系统时间写入到硬件时间(如果只修改系统时间,每次开机系统时间还会改回硬件时间),命令如下,
sudo hwclock --systohc

3. 让系统定期从时间服务器更新一下时间。配置/etc/ntpd.conf和/etc/conf.d/ntp-client,然后可以把ntp-client和ntpd加入default run level,命令如下,
sudo rc-update add ntpd default
sudo rc-update add ntp-client default

 

 

原文连接:http://hi.baidu.com/3444542/blog/item/e9f50beee5f1bc2c2cf534f1.html

你可能感兴趣的:(html,windows,xml,Blog,bash)