cat /var/log/syslog |grep Synchronise
Feb 8 20:49:22 hwy systemd[1]: Starting Synchronise Hardware Clock to System Clock...
如何获取在重新启动期间将硬件时钟同步到系统时钟的程序名称?systemctl 可以告诉我在重新启动期间将硬件时钟同步到系统时钟的程序名称吗?
答案1
/lib/systemd/system/hwclock-save.service
[root@hostname username]# more /lib/systemd/system/hwclock-save.service
[Unit]
Description=Synchronise Hardware Clock to System Clock
DefaultDependencies=no
Before=shutdown.target
ConditionFileIsExecutable=!/usr/sbin/ntpd
ConditionFileIsExecutable=!/usr/sbin/openntpd
ConditionFileIsExecutable=!/usr/sbin/chrony
ConditionVirtualization=!container
[Service]
Type=oneshot
ExecStart=/sbin/hwclock -D --systohc
[Install]
WantedBy=reboot.target halt.target poweroff.target
所以它似乎最终会调用/sbin/hwclock