diff --git a/nspawn-container/scripts/0-setup-system.sh b/nspawn-container/scripts/0-setup-system.sh index 18cda64..60646d2 100644 --- a/nspawn-container/scripts/0-setup-system.sh +++ b/nspawn-container/scripts/0-setup-system.sh @@ -1,7 +1,9 @@ #!/bin/bash -# This script installs systemd-container if it's not installed. +# This script installs systemd-container if it's not installed. # Also links any containers from /data/custom/machines to /var/lib/machines. +set -e + if ! dpkg -l systemd-container | grep ii >/dev/null; then if ! apt -y install systemd-container debootstrap; then yes | dpkg -i /data/custom/dpkg/*.deb diff --git a/nspawn-container/scripts/setup-system.service b/nspawn-container/scripts/setup-system.service index 91fb0ef..bb736ea 100644 --- a/nspawn-container/scripts/setup-system.service +++ b/nspawn-container/scripts/setup-system.service @@ -2,11 +2,13 @@ Description=Setup custom container service Wants=network-online.target After=network-online.target +StartLimitBurst=5 [Service] Type=oneshot ExecStart=/data/on_boot.d/0-setup-system.sh RemainAfterExit=yes +RestartSec=30 [Install] WantedBy=multi-user.target