首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我不能设置基于手臂的Debian日期和时间!

我不能设置基于手臂的Debian日期和时间!
EN

Unix & Linux用户
提问于 2016-11-23 05:22:18
回答 1查看 693关注 0票数 1

我有一个手臂板(纳米m1,类似覆盆子),我试着更新日期和时间!我使用了我在网络上看到的每一种方法,但都不起作用!(实际上,我的默认日期是1970年,但我更改了timesyncd.confntp.conf,并将服务器设置为0-4.ir.pool.ntp.org iburst,我的日期更改为2014年!)

我怎样才能解决这个问题?

这是我的"ntp.conf“文件的内容:

代码语言:javascript
复制
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift


# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable


# You do need to talk to an NTP server or two (or three).
#server ntp.your-provider.example

# pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will
# pick a different set every time it starts up.  Please consider joining the
# pool: <http://www.pool.ntp.org/join.html>
#server 0.debian.pool.ntp.org iburst
#server 1.debian.pool.ntp.org iburst
#server 2.debian.pool.ntp.org iburst
#server 3.debian.pool.ntp.org iburst
server 1.ir.pool.ntp.org
server 1.asia.pool.ntp.org
server 0.asia.pool.ntp.org

# Access control configuration; see /usr/share/doc/ntp-doc/html/accopt.html for
# details.  The web page <http://support.ntp.org/bin/view/Support/AccessRestrictions>
# might also be helpful.
#
# Note that "restrict" applies to both servers and clients, so a configuration
# that might be intended to block requests from certain clients could also end
# up blocking replies from your own upstream servers.

# By default, exchange time with everybody, but don't allow configuration.
restrict -4 default kod notrap nomodify nopeer noquery
restrict -6 default kod notrap nomodify nopeer noquery

# Local users may interrogate the ntp server more closely.
restrict 127.0.0.1
restrict ::1

# Clients from this (example!) subnet have unlimited access, but only if
# cryptographically authenticated.
#restrict 192.168.123.0 mask 255.255.255.0 notrust


# If you want to provide time to your local subnet, change the next line.
# (Again, the address is an example only.)
#broadcast 192.168.123.255

# If you want to listen to time broadcasts on your local subnet, de-comment the
# next lines.  Please do this only if you trust everybody on the network!
#disable auth
#broadcastclient

此外,在运行此命令后,我还会得到以下警告:

代码语言:javascript
复制
systemctl enable fake-hwclock.service

Synchronizing state for fake-hwclock.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d fake-hwclock defaults
insserv: warning: script 'K01tightvncserver' missing LSB tags and overrides
insserv: warning: script 'tightvncserver' missing LSB tags and overrides
Executing /usr/sbin/update-rc.d fake-hwclock enable

insserv: warning: script 'K01tightvncserver' missing LSB tags and overrides
insserv: warning: script 'tightvncserver' missing LSB tags and overrides
EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2016-11-23 08:11:31

正确设置ntp服务器并运行hwclock --systohc命令。

然后安装fake-hwclock包,启用并启动fake-hwclock.service

代码语言:javascript
复制
systemctl enable fake-hwclock.service
systemctl start fake-hwclock.service
systemctl restart fake-hwclock.service

有些机器没有工作的实时时钟(RTC)单元,或者没有现有硬件的驱动程序。fake-hwclock是一组简单的脚本,用于定期保存内核的当前时钟(包括关机时),并在引导时恢复它,以便系统时钟至少保持在接近实时的水平。这将阻止一些问题,这些问题可能是由于系统认为它早在1970年就已经运行过而引起的,比如每次启动时都需要执行文件系统检查。最重要的是,在硬件停止或重新启动时,仍然建议使用NTP来处理假时钟“漂移”。

编辑

这个问题由runnig dpkg-reconfigure tzdata解决(来自@from 3486308注释)

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/325337

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档