centos7系统日志时间与系统时间相差8小时
发布时间:2020-12-13 22:09:48 所属栏目:Linux 来源:网络整理
导读:? 场景:当我们修改完系统时间的时区后,我们去查看我们的系统日志的时间发现时区还是在之前的系统时间时区。 [root@vp-n ~]# ls -l /etc/localtime lrwxrwxrwx 1 root root 33 May 22 11:59 /etc/localtime - /usr/share/zoneinfo/Asia/Shanghai [root@vp-n
? 场景:当我们修改完系统时间的时区后,我们去查看我们的系统日志的时间发现时区还是在之前的系统时间时区。 [root@vp-n ~]# ls -l /etc/localtime
?你可以看到上方我的系统时间是下午的时间(也就是北京时间),但是我看日志的记录时间还是以之前的时区进行记录日志,这会导致我们以后对一些故障的时间判断造成影响。 解决方法:我们需要重启一下我们的系统日志服务(rsyslog),(你也可以重启系统,但是你懂的) systemctl restart rsyslog
之后这个问题就可以解决了。日志就恢复正常了。 [root@vp-n ~]# tail -1 /var/log/secure
May 22 14:24:35 vp-n polkitd[441]: Unregistered Authentication Agent for unix-process:10575:113412152 (system bus name :1.713,object path /org/freedesktop/PolicyKit1/AuthenticationAgent,locale en_US.UTF-8) (disconnected from bus)
[root@vp-n ~]# date
Tue May 26:38 CST 2018
在此做个记录,便于以后查询。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |