Files
configpolicy/roles/zwavejs2mqtt/templates/zwavejs2mqtt.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
876 B
Django/Jinja

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