LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2035|回复: 9

Gentoo时间老是不对。(解决)

[复制链接]
发表于 2008-7-4 12:42:38 | 显示全部楼层 |阅读模式
某次升级后Gentoo的时间就老是不对,一直开机就要调时间。
我的配置:

  1. wsw@localhost ~ $ ls -l /etc/localtime
  2. lrwxrwxrwx 1 root root 33 2008-07-01 18:12 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai
复制代码

  1. wsw@localhost ~ $ cat /etc/conf.d/clock
  2. # /etc/conf.d/clock

  3. # Set CLOCK to "UTC" if your system clock is set to UTC (also known as
  4. # Greenwich Mean Time).  If your clock is set to the local time, then
  5. # set CLOCK to "local".  Note that if you dual boot with Windows, then
  6. # you should set it to "local".

  7. CLOCK="local"

  8. # Select the proper timezone.  For valid values, peek inside of the
  9. # /usr/share/zoneinfo/ directory.  For example, some common values are
  10. # "America/New_York" or "EST5EDT" or "Europe/Berlin".  If you want to
  11. # manage /etc/localtime yourself, set this to "".

  12. TIMEZONE="Asia/Shanghai"

  13. # If you wish to pass any other arguments to hwclock during bootup,
  14. # you may do so here.

  15. CLOCK_OPTS=""

  16. # If you want to set the Hardware Clock to the current System Time
  17. # during shutdown, then say "yes" here.

  18. CLOCK_SYSTOHC="yes"


  19. ### ALPHA SPECIFIC OPTIONS ###

  20. # If your alpha uses the SRM console, set this to "yes".
  21. SRM="no"

  22. # If your alpha uses the ARC console, set this to "yes".
  23. ARC="no"
复制代码

似乎就这两个配置了吧,但是每次系统启动还是时间不对。(上次设置时间是用hwclock --systohc过的。)不知是什么原因?
发表于 2008-7-4 13:56:17 | 显示全部楼层
emerge ntpdate
然后加入开机启动。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-4 16:44:50 | 显示全部楼层
是netdate? 为什么要去net上sync时间,难道说我的硬件不行了,一关电源就把时间掉了? 应该不是这个问题吧。
回复 支持 反对

使用道具 举报

发表于 2008-7-4 17:58:42 | 显示全部楼层
试试看CLOCK="UTC"
回复 支持 反对

使用道具 举报

发表于 2008-7-4 18:24:07 | 显示全部楼层
现在gentoo 的clock配置文件为/etc/conf.d/hwclock。顺便设置成“NO”试试。
#
CLOCK_SYSTOHC="yes"

mine:
# 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="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=""
回复 支持 反对

使用道具 举报

发表于 2008-7-4 19:04:26 | 显示全部楼层
clock="local"

clock_systohc="NO"

clock_args="--directisa"

改成这样就行了。
回复 支持 反对

使用道具 举报

发表于 2008-7-4 21:06:42 | 显示全部楼层
Post by gentookit;1870999
clock="local"

clock_systohc="NO"

clock_args="--directisa"

改成这样就行了。


我的就是这样解决的
如果#hwclock ---directisa显示时间正确,就可已给它加上--directisa参数。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-7-7 08:42:49 | 显示全部楼层
谢谢各位,原来配置文件变了。
已经解决了。
回复 支持 反对

使用道具 举报

发表于 2009-4-12 13:49:03 | 显示全部楼层
你怎么更改的?告诉我一下。我的时间也不对,开机提示时间错误,但是执行date命令显示正确。
回复 支持 反对

使用道具 举报

发表于 2009-4-12 14:03:06 | 显示全部楼层
我的/etc/localtime文件都删除了,在/etc/timezone里设置Asia/Shanghai,在/etc/config/hwclock里设置clock="local"
没有问题.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表