|
在图形界面更改时间没有反应,在终端下运行 system-config-date出现以下错误:
[iyunv@akinlau ~]# system-config-date
Traceback (most recent call last): File "/usr/share/system-config-date/system-config-date.py", line 82, in ? useGuiMode(page)
File "/usr/share/system-config-date/system-config-date.py", line 57, in useGuiMode scdMainWindow.scdMainWindow(page).stand_alone()
File "/usr/share/system-config-date/scdMainWindow.py", line 232, in __init__ self.datePage = date_gui.datePage (self.dateBackend, self.xml)
File "/usr/share/system-config-date/date_gui.py", line 160, in __init__ (self.ntpServers, self.ntpLocalTimeSource)=scdMainWindow.dateBackend.getNtpServers ()
TypeError: unpack non-sequence
解决方法:
1.首先看用以下命令看一下系统时间和BIOS时间一不一致
[iyunv@akinlau ~]#date;hwclock -r
如果不一致的话先修改系统时间再写入到BIOS里
[iyunv@akinlau ~]#date MMDDhhmmyyyy //M表示月份,D表示日期,h表示小时,m表示分钟,y表示年份
[iyunv@akinlau ~]#hwclock -w //把系统时间写入到BIOS里
[iyunv@akinlau ~]#system-config-date //如果这里不能成功打开话,那就是ntp的问题了,请看2.
2.如果第一种方法解决不了的话,就查看一下ntp正不正常,首先我们先查看一下配置文件存不存在:
[iyunv@akinlau ~]#ls /etc |grep ntp
ntp ntp.conf //正常情况下会显示一个ntp文件夹和ntp.conf配置文件,如果没有就新建一个
[iyunv@akinlau ~]#vi /etc/ntp.conf //内容如下,以下内容是RHEL6默认的配置文件内容
# For more information about this file, see the man pages # ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).
driftfile /var/lib/ntp/drift
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system. restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery
# Permit all access over the loopback interface. This could
# be tightened as well, but to do so would effect some of
# the administrative functions. restrict 127.0.0.1 restrict -6 ::1
# Hosts on local network are less restricted.
#restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html). server 0.rhel.pool.ntp.org server 1.rhel.pool.ntp.org server 2.rhel.pool.ntp.org
#broadcast 192.168.1.255 autokey
# broadcast server
#broadcastclient
# broadcast client
#broadcast 224.0.1.1 autokey
# multicast server
#multicastclient 224.0.1.1
# multicast client
#manycastserver 239.255.254.254
# manycast server
#manycastclient 239.255.254.254 autokey
# manycast client
# Undisciplined Local Clock. This is a fake driver intended for backup # and when no outside source of synchronized time is available. #server 127.127.1.0
# local clock
#fudge 127.127.1.0 stratum 10
# Enable public key cryptography.
#crypto
includefile /etc/ntp/crypto/pw
# Key file containing the keys and key identifiers used when operating
# with symmetric key cryptography. keys /etc/ntp/keys
# Specify the key identifiers which are trusted.
#trustedkey 4 8 42
# Specify the key identifier to use with the ntpdc utility.
#requestkey 8
# Specify the key identifier to use with the ntpq utility.
#controlkey 8
# Enable writing of statistics records.
#statistics clockstats cryptostats loopstats peerstats
----------------------------------------------------------分隔线不要复制---------------------------------------------------------------------------------------
新建好ntp.conf后,重启一下ntp服务,然后再试一下能不能打开
[iyunv@akinlau ~]#service ntpd restart
[iyunv@akinlau ~]#system-config-date
|
|