LinuxSir.cn,穿越时空的Linuxsir!

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

gentoo的时间问题,说gentoo时间不准的进来看

[复制链接]
发表于 2004-11-13 10:33:11 | 显示全部楼层 |阅读模式
原来的方法是说在/etc/rc.conf中改
#time
CLOCK="UTC"

#time
CLOCK="local"

但是,最近,我注意到CLOCK一段已经从最新的rc.conf中去除了,当然你可以手工添加这段。不过,大家最好关注一下这个。

/etc/init.d/clock
启动级别是boot,而且是kernel级的服务。
它的配置文件在
/etc/conf.d/clock
让我们看看它。
[PHP]# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-src/rc-scripts/etc/conf.d/clock,v 1.2 2004/10/25 06:25:32 vapier Exp $

# 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".
# 默认是UTC,因此,如果你在rc.conf里面改了为local的话,这里也得改成local;而且,rc.conf里的,我想可以不要了。因为,启动时的时区设置,已这里为准
CLOCK="local"

# If you wish to pass any other arguments to hwclock during bootup,
# you may do so here.
#这段不懂,不用理

CLOCK_OPTS=""

# If you want to sync the system clock to the hardware clock during
# shutdown, then say "yes" here.
# 说gentoo计算时间不准的,看这里,为no的时候,gentoo不会同步计算的硬件时间为gentoo的系统时间。也就是说,每次启动的时候gentoo从硬件读取时间,但是却从不改变它。那么,你再遇到时间不准,只能承认这是你自己的硬件的问题,跟gentoo无关
#PS:硬件时间就是BIOS的时间了。
#PS2:不该变时间是默认选项

CLOCK_SYSTOHC="no"

#下面的设置,与alpha处理器架构的有关。So,pass
### ALPHA SPECIFIC OPTIONS ###

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

# If your alpha uses the ARC console, set this to "yes".
ARC="no"[/PHP]
发表于 2004-11-13 10:44:42 | 显示全部楼层
觉得gentoo的时间有问题
比如我用livecd启动从stage1开始安装gentoo,系统从硬件读出时间xx:xx,认为是UTC,然后我根据手册,做完stage2,ln -sf /use/share/zoneinfo... /etc/localtime,把北京时间链接到localtime,然后编译内核,做完其他的,把CLOCK设定为local,重启
然后问题就来了,启动以后用date命令发现时间正确,但是你安装时编译的文件创建时间都在8个小时之后,此时你想编译内核什么都会提示clock clew
这样安装gentoo前,先要把系统时间回调8小时,安装完后再调回来,这个系统的时间包括文件创建时间才不会出错
发表于 2004-11-13 13:38:44 | 显示全部楼层
没遇到过系统时间的问题。

我怎么没有/etc/conf.d/clock?
发表于 2004-11-13 14:08:55 | 显示全部楼层
我也没有,天天更新的。
 楼主| 发表于 2004-11-13 15:26:30 | 显示全部楼层
都没有吗?
:ask :ask

我的怎么有呢?
你们有用ntpd更新时间吗?
 楼主| 发表于 2004-11-13 15:46:03 | 显示全部楼层
最初由 hutigers 发表
都没有吗?
:ask :ask

我的怎么有呢?
你们有用ntpd更新时间吗?


你们都没有这个包吗?不太可能吧?
tux ~ # qpkg -f /etc/init.d/clock
sys-apps/baselayout *
发表于 2004-11-13 15:51:58 | 显示全部楼层
/etc/init.d/clock当然有,但没有/etc/conf.d/clock。
我没用nptd,但每次进系统都会执行:
# rdate -p -s clock.psu.edu && hwclock --systohc &
 楼主| 发表于 2004-11-13 15:57:58 | 显示全部楼层
最初由 kohno 发表
/etc/init.d/clock当然有,但没有/etc/conf.d/clock。
我没用nptd,但每次进系统都会执行:
# rdate -p -s clock.psu.edu && hwclock --systohc &


[PHP]Configuration files:
    There are three files which will be sourced for possible configuration by
    the rc-scripts.  They are (sourced from top to bottom):

    /etc/conf.d/basic
    /etc/conf.d/clock
    /etc/rc.conf[/PHP]

先后顺序是由上至下。

也就是说,/etc/conf.d/clock比/etc/rc.conf优先。

PS:上面的那个是执行/etc/init.d/clock得到的。无需任何参数。
发表于 2004-11-13 16:11:23 | 显示全部楼层
呵呵,我系统里即没有/etc/conf.d/basic,也没有/etc/conf.d/clock,换句话说只有设置/etc/rc.conf才会生效了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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