Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Linux机器上,由于未知原因,系统时间会自动更改_Linux_Ntp_Systemtime - Fatal编程技术网

在Linux机器上,由于未知原因,系统时间会自动更改

在Linux机器上,由于未知原因,系统时间会自动更改,linux,ntp,systemtime,Linux,Ntp,Systemtime,在我的一台Linux机器上,系统时间出现了一个非常奇怪的问题,系统时间被自动更改为比本地时间提前40秒。无论何时重置,都会在几秒钟后更改,如您从以下输出中看到的: [root@node ~]# date; date -s "2018-01-23 14:06:40";sleep 5;date Tue Jan 23 14:07:21 CST 2018 Tue Jan 23 14:06:40 CST 2018 Tue Jan 23 14:07:26 CST 2018 ntpd服务已停止,并且没有运行

在我的一台Linux机器上,系统时间出现了一个非常奇怪的问题,系统时间被自动更改为比本地时间提前40秒。无论何时重置,都会在几秒钟后更改,如您从以下输出中看到的:

[root@node ~]# date; date -s "2018-01-23 14:06:40";sleep 5;date
Tue Jan 23 14:07:21 CST 2018
Tue Jan 23 14:06:40 CST 2018
Tue Jan 23 14:07:26 CST 2018
ntpd
服务已停止,并且没有运行cronjob来更改系统时间。我试图添加审核规则以跟踪时间更改事件,但没有记录,审核规则附加到
/etc/audit/audit.rules

-a always,exit -F arch=b64 -S clock_adjtime -S adjtimex  -S time -S timer_settime -S settimeofday -S clock_settime -k time_change
-w /etc/localtime -p rxwa -k access_localtime
-w /etc/adjtime -p rxwa -k access_adjtime
service auditd重启后
,我可以通过
ntpdate time.windows.com
查看
/var/log/audit/audit.log
中的时间更改日志:

[root@node ~]# ntpdate time.windows.com
23 Jan 13:08:24 ntpdate[14584]: step time server 52.178.161.41 offset -61.612892 sec

Logs of the above command:

type=SYSCALL msg=audit(1516684164.838:3093): arch=c000003e syscall=223 success=yes exit=0 a0=0 a1=0 a2=7fff507e2600 a3=0 items=0 ppid=14397 pid=14584 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=47 comm="ntpdate" exe="/usr/sbin/ntpdate" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key="time_change"
type=SYSCALL msg=audit(1516684166.521:3094): arch=c000003e syscall=227 success=yes exit=0 a0=0 a1=7fff507e2110 a2=0 a3=0 items=0 ppid=14397 pid=14584 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=47 comm="ntpdate" exe="/usr/sbin/ntpdate" subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 key="time_change"
或通过日期-s:

但是,如果没有任何有用的审计日志,时间很快就会再次改变。顺便说一句,这是一个由Hyper-V在刀片服务器上管理的虚拟机,但在同一刀片服务器上的其他虚拟机上没有这样的问题

操作系统环境信息:

[root@node ~]# uname -a
Linux node 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@node ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)

有人能告诉我为什么会这样吗?非常感谢:-)

我投票将此问题作为离题题结束,因为它与编程无关,而且您的问题更适合StackExchange网站或应用程序。
[root@node ~]# uname -a
Linux node 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@node ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)