Delay Supervisor start until time has been sychronized (#1360)

* Enable systemd-time-wait-sync.service by default

Enable the systemd-time-wait-sync.service by default. This allows to use
the time-sync.target which allows to make sure services only get started
once the time is synchronized.

* Make sure time is synchronized when starting  hassos-supervisor.service

Use the time-sync.target to make sure that the Supervisor gets stsarted
after the time has been synchronized.

* Set timeout for systemd-time-wait-sync.service

Don't delay startup forever in case time synchronization doesn't work.
This allows to boot the system even without Internet connection.
This commit is contained in:
Stefan Agner 2021-05-12 17:47:42 +02:00 committed by GitHub
parent 9dd269d766
commit 2d3119ef22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,2 @@
[Service]
TimeoutStartSec=90s

View File

@ -1 +1,3 @@
disable apparmor.service
enable systemd-time-wait-sync.service

View File

@ -1,8 +1,8 @@
[Unit]
Description=HassOS supervisor
Requires=docker.service rauc.service dbus.service
Wants=network-online.target hassos-apparmor.service
After=docker.service rauc.service dbus.service network-online.target
Wants=network-online.target hassos-apparmor.service time-sync.target
After=docker.service rauc.service dbus.service network-online.target time-sync.target
RequiresMountsFor=/mnt/data /mnt/boot /mnt/overlay
StartLimitIntervalSec=60
StartLimitBurst=5