时间配置不会通过重新启动保持

sae*_*gnu 4 time time-zone arch-linux ntp

我使用 ArchLinux 并且我的系统时间出现问题已经好几个月了。

以前它可以工作,但是一旦我更新了我的 PC,系统时间在每次启动时都会发生变化(就像它没有检测时区,而 rc.conf 中的时区是正确的)。

然后我添加了 hwclock 并且它是相同的,然后将其删除。如果我没记错的话,这似乎解决了问题。

当我所在国家/地区的夏令时更改时,每次启动时时间都会改变 1 小时(无论我手动或通过 ntpdate 设置多少次系统时间)。

我再次尝试解决这个问题,现在它像以前一样有很多小时班次(班次值是 UTC 和本地时间的差异)。而现在,似乎我的系统时间是不可更改的。我把时间date -s ...ntpdate pool.ntp.org例如...,但似乎这些措施不会在重新启动后仍然存在。我在运行 hwclock 守护进程、运行 ntpd 的情况下尝试了它,但它们都没有在 DAEMONS 中运行。我真的很困惑。

我不经常使用窗户。而且我知道在 linux 中启动 Windows 会导致系统时间出现问题。但这不是我的问题。每次启动 windows 和 linux 时,我都可以手动或 ntpdate 命令重置系统时间。所以你可以假设我的机器上没有任何窗口。

我只想让我的系统时间工作而不是自动更改(通过 ntp 或其他方式),只需在需要时手动设置(手动或 ntpdate 命令)。请帮忙。

这是我的 rc.conf

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# DAEMON_LOCALE: If set to 'yes', use $LOCALE as the locale during daemon
# startup and during the boot process. If set to 'no', the C locale is used.
# HARDWARECLOCK: set to "", "UTC" or "localtime", any other value will result
#   in the hardware clock being left untouched (useful for virtualization)
#   Note: Using "localtime" is discouraged, using "" makes hwclock fall back
#   to the value in /var/lib/hwclock/adjfile
# TIMEZONE: timezones are found in /usr/share/zoneinfo
#   Note: if unset, the value in /etc/localtime is used unchanged
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="UTC"
TIMEZONE="Asia/Tehran"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MODULES: Modules to load at boot-up. Blacklisting is no longer supported.
#   Replace every !module by an entry as on the following line in a file in
#   /etc/modprobe.d:
#     blacklist module
#   See "man modprobe.conf" for details.
#
MODULES=(wl vboxdrv)

# Udev settle timeout (default to 30)
UDEV_TIMEOUT=30

# Scan for FakeRAID (dmraid) Volumes at startup
USEDMRAID="no"

# Scan for BTRFS volumes at startup
USEBTRFS="no"

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="ilius-vostro3300"

# Use 'ip addr' or 'ls /sys/class/net/' to see all available interfaces.
#
# Wired network setup
#   - interface: name of device (required)
#   - address: IP address (leave blank for DHCP)
#   - netmask: subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0)
#   - broadcast: broadcast address (ignored for DHCP) (optional)
#   - gateway: default route (ignored for DHCP)
# 
# Static IP example
# interface=eth0
# address=192.168.0.2
# netmask=255.255.255.0
# broadcast=192.168.0.255
# gateway=192.168.0.1
#
# DHCP example
# interface=eth0
# address=
# netmask=
# gateway=

interface=
address=
netmask=
broadcast=
gateway=

# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"

# Enable these netcfg profiles at boot-up. These are useful if you happen to
# need more advanced network features than the simple network service
# supports, such as multiple network configurations (ie, laptop users)
#   - set to 'menu' to present a menu during boot-up (dialog package required)
#   - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This requires the netcfg package
#
#NETWORKS=(main)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
#   - prefix a daemon with a ! to disable it
#   - prefix a daemon with a @ to start it up in the background
#
# If something other takes care of your hardware clock (ntpd, dual-boot...)
# you should disable 'hwclock' here.
#
DAEMONS=(syslog-ng dbus wicd)

## REMOVED: netfs network crond hwclock 
## ADDED: dbus networkmanager sshd nfs-common bluetooth samba httpd postgresql IBSng starcal2d wicd
Run Code Online (Sandbox Code Playgroud)

bri*_*ice 5

Ilius,我想我以前遇到过这个问题。

  1. 首先尝试正确设置系统时间。(ntp/随便)
  2. 然后,运行 hwclock --systohc

这应该将您的 hwclock 重置为系统时间,并且应该在重新启动后保持不变。

你会告诉我们它是否有效吗?


归档时间:

查看次数:

10611 次

最近记录:

7 年,11 月 前