Files
configpolicy/roles/zigbee2mqtt/templates/zigbee2mqtt.service.j2
Dustin C. Hatch e55fc8f5af r/homeassistant et al.: Increase start timeout
The first time launching a container after pulling a new image, it can
take several minutes for the container to actually start.  Podman has to
set up the overlay filesystems, which is very slow on a Raspberry Pi.

With the default start timeout, systemd may end up killing the process
before the container is completely set up.  Thus, we need to increase
the timeout to ensure there is plenty of time for Podman to work.
2021-12-20 09:59:14 -06:00

31 lines
895 B
Django/Jinja

[Unit]
Description=Zigbee2MQTT
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
NotifyAccess=all
ExecStartPre=/usr/bin/setfacl -m zigbee2mqtt:rw {{ zigbee2mqtt_device }}
ExecStartPre=/usr/bin/chcon -t console_device_t {{ zigbee2mqtt_device }}
ExecStartPre=-/usr/bin/podman container rm --ignore -f zigbee2mqtt
ExecStart=/usr/bin/podman run \
--pull never \
--sdnotify=conmon --cgroups=no-conmon \
--rm \
--network=host \
--name zigbee2mqtt \
-v /var/lib/zigbee2mqtt:/app/data:Z \
--uidmap 0:{{ zigbee2mqtt_user.uid }}:1 \
--gidmap 0:{{ zigbee2mqtt_user.group }}:1 \
--uidmap 1:5100001:1024 \
--gidmap 1:5100001:1024 \
--device {{ zigbee2mqtt_device }}:{{ zigbee2mqtt_container_device }}:rw \
docker.io/koenkk/zigbee2mqtt:latest
ProtectSystem=full
UMask=0077
TimeoutStartSec=5min
[Install]
WantedBy=multi-user.target