unifios-utilities/nspawn-container/scripts/setup-system.service
Micah Hausler 070ff2ade6
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>
2024-01-11 10:05:01 -08:00

16 lines
265 B
Desktop File

[Unit]
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