Files
configpolicy/roles/homeassistant/templates/homeassistant.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

29 lines
733 B
Django/Jinja

# vim: set ft=systemd :
[Unit]
Description=Home Assistant
After=network-online.target
Wants=network-online.target
[Service]
Type=notify
NotifyAccess=all
ExecStartPre=-/usr/bin/podman container rm --ignore -f homeassistant
ExecStart=/usr/bin/podman run \
--pull never \
--sdnotify=conmon --cgroups=no-conmon \
--rm \
--network=host \
--name homeassistant \
-v /var/lib/homeassistant:/config:Z \
--uidmap 0:{{ homeassistant_user.uid }}:1 \
--gidmap 0:{{ homeassistant_user.group }}:1 \
--uidmap 1:4000000:65536 \
--gidmap 1:4000000:65536 \
ghcr.io/home-assistant/{{ homeassistant_image_name }}:stable
ProtectSystem=full
UMask=0077
TimeoutStartSec=5min
[Install]
WantedBy=multi-user.target