大网数据广告活动
服务器运维问答

System clock always resyncs after setting it

· 52CE 我爱测

I'm setting the system clock using the following command: date -s "31 DEC 2015 12:00:00" Immediately after executing I run just date and see that the date and time is December 31 2015. Then, after waiting about three seconds, I r…

问题原文

原帖链接 · The Unknown Dev · CC BY-SA 3.0

I'm setting the system clock using the following command:

date -s "31 DEC 2015 12:00:00"

Immediately after executing I run just date and see that the date and time is December 31 2015. Then, after waiting about three seconds, I run date again and see that it has changed back to today's date.

Why is it syncing again to the current date and how can I stop it?

[root@localhost mm]# date -s "31 DEC 2015 12:00:00"
Thu Dec 31 12:00:00 EST 2015
[root@localhost mm]# date
Thu Dec 31 12:00:02 EST 2015
[root@localhost mm]# date
Thu Dec 31 12:00:03 EST 2015
[root@localhost mm]# date
Mon Jan  4 11:53:17 EST 2016

All my currently running services:

[root@localhost mm]# service --status-all
atd (pid  2317) is running...
auditd (pid  1464) is running...
consul (pid  2332) is running...
crond (pid  2212) is running...
cupsd (pid  1562) is running...
dnsmasq is stopped
elasticsearch (pid  4046) is running...
service firstboot supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add firstboot')
firstboot is not scheduled to run
hald (pid  1604) is running...
htcacheclean is stopped
httpd (pid  7537) is running...
ip6tables: Firewall is not running.
iptables: Firewall is not running.
iscsi is stopped
iscsid is stopped
Checking jexec statuslvmetad is stopped
dmeventd is stopped
mdmonitor is stopped
memcached (pid 2181) is running...
messagebus (pid  1527) is running...
mongod (pid  2293) is running...
multipathd is stopped
mysqld (pid  2067) is running...
netconsole module not loaded
Configured devices:
lo eth0 eth1
Currently active devices:
lo eth0 eth1
NetworkManager (pid  1540) is running...
ntpd is stopped
portreserve is stopped
master dead but pid file exists
pppoe-server is stopped
rdisc is stopped
rsyslogd (pid  1498) is running...
sandbox is stopped
saslauthd is stopped
sendmail (pid  2288) is running...
sm-client (pid  2289) is running...
spice-vdagentd is stopped
openssh-daemon (pid  1811) is running...
The VirtualBox Additions are currently running.
Checking for VBoxService ...running
wdaemon is stopped
winbindd is stopped
wpa_supplicant (pid  1603) is running...

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

It's because your machine is a VirtualBox virtual machine, and

The VirtualBox Additions are currently running.

By default VirtualBox guests will sync their time to the host. If you want to change this behavior, see the documentation.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-01-04)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。