r/z*2mqtt: Restart services after unexpected stop

Both *zwavejs2mqtt* and *zigbee2mqtt* have various bugs that can cause
them to crash in the face of errors that should be recoverable.
Specifically, when there are network errors, the processes do not always
handle these well.  Especially during first startup, they tend to crash
instead of retry.  Thus, we'll move the retry logic into systemd.
btop
Dustin 2022-08-21 22:25:12 -05:00
parent 465aa4d78e
commit 31c73e696f
2 changed files with 2 additions and 0 deletions

View File

@ -24,6 +24,7 @@ ExecStart=/usr/bin/podman run \
--gidmap 1:5100001:1024 \ --gidmap 1:5100001:1024 \
--device {{ zigbee2mqtt_device }}:{{ zigbee2mqtt_container_device }}:rw \ --device {{ zigbee2mqtt_device }}:{{ zigbee2mqtt_container_device }}:rw \
docker.io/koenkk/zigbee2mqtt:latest docker.io/koenkk/zigbee2mqtt:latest
Restart=always
ProtectSystem=full ProtectSystem=full
UMask=0077 UMask=0077
TimeoutStartSec=5min TimeoutStartSec=5min

View File

@ -24,6 +24,7 @@ ExecStart=/usr/bin/podman run \
--gidmap 1:5000001:1024 \ --gidmap 1:5000001:1024 \
--device {{ zwavejs_device }}:{{ zwavejs_device_container}}:rw \ --device {{ zwavejs_device }}:{{ zwavejs_device_container}}:rw \
docker.io/zwavejs/zwavejs2mqtt:latest docker.io/zwavejs/zwavejs2mqtt:latest
Restart=always
ProtectSystem=full ProtectSystem=full
UMask=0077 UMask=0077
TimeoutStartSec=5min TimeoutStartSec=5min