dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 576c052034da93fbc7cb4ac898bf95ced0e2b464 (tree)
parent 36a135d5620af350727927b0c9af0c545e5beb15
Author: Motiejus Jakštys <desired.mta@gmail.com>
Date:   Tue,  2 Jun 2020 14:35:48 +0300

add hass2.service

Diffstat:
Aroot/rpi4b/etc/systemd/system/hass2.service | 33+++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+), 0 deletions(-)

diff --git a/root/rpi4b/etc/systemd/system/hass2.service b/root/rpi4b/etc/systemd/system/hass2.service @@ -0,0 +1,33 @@ +[Unit] +Description=home-assistant +Wants=network-online.target systemd-resolved.service +After=network-online.target systemd-resolved.service + +[Service] +ExecStartPre=dockerlike-root hass2 homeassistant/home-assistant:0.107.7 +ExecStartPre=sh -c "jq 'del(.linux.namespaces[]|select(.type==\"network\"))' /var/lib/oci/hass2/config.json | sponge /var/lib/oci/t2/config.json" +ExecStart=systemd-nspawn \ + --keep-unit \ + --machine=hass2 \ + --capability=CAP_CHOWN \ + --oci-bundle=/var/lib/oci/%i \ + --template=/var/lib/oci/%i/rootfs \ + -U +KillMode=mixed +Type=notify +RestartForceExitStatus=133 +SuccessExitStatus=133 +Slice=machine.slice +Delegate=yes +TasksMax=16384 +WatchdogSec=3min + +# Enforce a strict device policy, similar to the one nspawn configures when it +# allocates its own scope unit. Make sure to keep these policies in sync if you +# change them! +DevicePolicy=closed +DeviceAllow=/dev/net/tun rwm +DeviceAllow=char-pts rw + +[Install] +WantedBy=multi-user.target