意外地出校隔离了一周的时间,期间网线又松了😓。不过奇怪的是这次有了脚本之后vpn-up脚本仍然有概率挂掉,查日志时发现同样的报错。
text
1Mar 07 20:56:04 playground.palemoons.tech NetworkManager[2820203]: <warn> [1646657764.4278] vpn-connection[0x558eb8780330,3cf669e1-6c19-40fc-8409-b111fb4eb32e,"vpn-zjunet0",0]: VPN connection: failed to connect: 'couldn't look up L2TP VPN gateway IP address '总之很奇怪,但暂时无法稳定复现,只能先搁置在这里了。
问题
重新联网之后注意到玩具车似乎没有时间同步,和Mac上的时间差了不少。于是决定检查。
分析
首先datetimectl status检查系统时间的情况。
text
1[root@playground systemd]# timedatectl status
2 Local time: Mon 2022-03-07 21:51:50 CST
3 Universal time: Mon 2022-03-07 13:51:50 UTC
4 RTC time: Mon 2022-03-07 13:51:50
5 Time zone: Asia/Shanghai (CST, +0800)
6System clock synchronized: no
7 NTP service: inactive
8 RTC in local TZ: no发现NTP service未激活,因此按照Arch Wiki的教程启动同步。
systemctl enable systemd-timesyncd创建后台任务。编辑
/etc/systemd/timesyncd.conf。
text
1[Time]
2NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
3FallbackNTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
4RootDistanceMaxSec=5
5PollIntervalMinSec=32
6PollIntervalMaxSec=2048timedatectl show-timesync --all检查配置timedatectl set-ntp true设置NTP service状态timedatectl status重新确认状态。
text
1[root@playground systemd]# timedatectl status
2 Local time: Mon 2022-03-07 21:51:50 CST
3 Universal time: Mon 2022-03-07 13:51:50 UTC
4 RTC time: Mon 2022-03-07 13:51:50
5 Time zone: Asia/Shanghai (CST, +0800)
6System clock synchronized: yes
7 NTP service: active
8 RTC in local TZ: no若状态未改变,则重启systemd-timesyncd任务后再确认。