mirror of
https://github.com/unifi-utilities/unifios-utilities.git
synced 2024-08-30 18:32:21 +00:00
fix(nspawn-container): Retry 0-setup-system.sh on failure (#586)
Other system processes can acquire a dpkg frontend lock on startup that will cause the downloaded package install to fail. The setup script continues without exiting and machinectl is not found. This change forces the script to exit early on error, and adds 5 retries to the systemd unit at 30s intervals. Signed-off-by: Micah Hausler <hausler.m@gmail.com>
This commit is contained in:
parent
2a5ca12790
commit
070ff2ade6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user