Rus*_* FP 15 time syslog systemd 16.04
我有个问题。有这样的消息
Mar 1 15:52:34 ubuntu systemd[1]: Time has been changed
Mar 1 15:52:34 ubuntu systemd[1]: snapd.refresh.timer: Adding 1h 16min 25.978183s random time.
Mar 1 15:52:34 ubuntu systemd[1]: apt-daily.timer: Adding 8h 21min 914.167ms random time.
Mar 1 15:52:34 ubuntu systemd[6041]: Time has been changed
Run Code Online (Sandbox Code Playgroud)
在 /var/log/syslog 中每 5 秒一次。似乎有什么东西在不断地改变着时间。这真的很烦人,我明白出了什么问题并想修复它。RTC 时间也不正确。
关于我的系统的一些信息:
timedatectl
:
Local time: ?? 2017-03-01 16:05:03 MSK
Universal time: ?? 2017-03-01 13:05:03 UTC
RTC time: ?? 2017-03-03 11:33:10
Time zone: Europe/Moscow (MSK, +0300)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: no
Run Code Online (Sandbox Code Playgroud)
iptables
:
Chain INPUT (policy DROP)
Chain OUTPUT (policy ACCEPT)
Run Code Online (Sandbox Code Playgroud)
该INPUT
链在我的规则。
systemctl list-units | grep running
acpid.path loaded active running ACPI Events Check
init.scope loaded active running System and Service Manager
acpid.service loaded active running ACPI event daemon
asterisk.service loaded active running Asterisk PBX
atd.service loaded active running Deferred execution scheduler
cron.service loaded active running Regular background program processing daemon
dbus.service loaded active running D-Bus System Message Bus
getty@tty1.service loaded active running Getty on tty1
hv-kvp-daemon.service loaded active running Hyper-V KVP Protocol Daemon
hv-vss-daemon.service loaded active running Hyper-V VSS Protocol Daemon
iscsid.service loaded active running iSCSI initiator daemon (iscsid)
lvm2-lvmetad.service loaded active running LVM2 metadata daemon
lxcfs.service loaded active running FUSE filesystem for LXC
mdadm.service loaded active running LSB: MD monitoring daemon
mysql.service loaded active running MySQL Community Server
openvpn@server.service loaded active running OpenVPN connection to server
rsyslog.service loaded active running System Logging Service
snapd.service loaded active running Snappy daemon
ssh.service loaded active running OpenBSD Secure Shell server
systemd-journald.service loaded active running Journal Service
systemd-timesyncd.service loaded active running Network Time Synchronization
systemd-udevd.service loaded active running udev Kernel Device Manager
user@1000.service loaded active running User Manager for UID 1000
vpsguard.service loaded active running VPSGUARD
acpid.socket loaded active running ACPID Listen Socket
dbus.socket loaded active running D-Bus System Message Bus Socket
lvm2-lvmetad.socket loaded active running LVM2 metadata daemon socket
snapd.socket loaded active running Socket activation for snappy daemon
Run Code Online (Sandbox Code Playgroud)
我试过:
sudo systemctl stop systemd-timesyncd.service
sudo hwclock -w
我没有安装 sclockadj。我还询问了我的 VDS 提供商是否阻止了任何 NTP 请求。不,他们没有。
更新 1
我设置了另一个完全相同的 VDS#2。systemd[1]: Time has been changed
几分钟后收到此消息,在该消息CRON[3684]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
出现并且问题消失之后。但是,我尝试升级 VDS#2,并且在重新启动后立即再次更改了此时间。
找到这个线程,也许它可以提供更多信息。看起来是内核问题。
试图降级内核、systemd、udev,但没有任何不起作用。正如我从一些回复中看到的,这不是我的主机和虚拟化的问题。
小智 22
我在 Windows 8.1 Hyper-V 下运行的 16.04 服务器上遇到了systemd[...]Time has been changed
每五秒记录一次消息的问题 /var/log/syslog
。为了解决这个问题,我在 Hyper-V 端禁用了时间同步。
在 Hyper-V 管理器中,我突出显示了 VM,选择了 Settings,然后是 Integration Services,取消选中了Time synchronization,然后单击了Apply。
消息立即停止 - 无需重新启动 VM。
在 HyperV/Azure 上,可以通过为 syslog 创建过滤器来禁用该消息。
在 /etc/rsyslog.d 中创建一个新文件
vi /etc/rsyslog.d/15-excludetime.conf
Run Code Online (Sandbox Code Playgroud)插入两行
:msg, contains, "Time has been changed" ~
:msg, contains, "apt-daily.timer: Adding" ~
Run Code Online (Sandbox Code Playgroud)重启 rsyslog
systemctl restart rsyslog.service
Run Code Online (Sandbox Code Playgroud)或者您可以禁用 VMBUS 上的主机时间同步。我把这行放在 /etc/rc.local 下
echo 2dd1ce17-079e-403c-b352-a1921ee207ee > /sys/bus/vmbus/drivers/hv_util/unbind
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
23238 次 |
最近记录: |