r/z*2mqtt: Wait for clock to sync before starting

The *zwavejs2mqtt* and *zigbee2mqtt* services need to wait until the
system clock is fully synchronized before starting.  If the system clock
is wrong, they may fail to validate the MQTT server certificate.

The *time-sync.target* unit is not started until after services that
sync the clock, e.g. using NTP.  Notably, the *chrony-wait.service* unit
delays *time-sync.target* until `chrony waitsync` returns.
btop
Dustin 2022-08-21 21:58:30 -05:00
parent 7044cf3a46
commit 465aa4d78e
2 changed files with 4 additions and 0 deletions

View File

@ -1,7 +1,9 @@
[Unit]
Description=Zigbee2MQTT
After=network-online.target
After=time-sync.target
Wants=network-online.target
Wants=time-sync.target
[Service]
Type=notify

View File

@ -1,7 +1,9 @@
[Unit]
Description=Zwavejs2Mqtt
After=network-online.target
After=time-sync.target
Wants=network-online.target
Wants=time-sync.target
[Service]
Type=notify