I have an otherwise working systemd-nspawn
managed container (minimal Ubuntu 16.04 from debootstrap
) but I cannot make it restart when crashed/rebooted.
The unit file is
# cat /etc/systemd/nspawn/minec.nspawn
[Exec]
Boot=yes
[Network]
Bridge=minec
[Service]
ExecStartPre=-/sbin/ip link del vb-minec
Restart=always
Specifically, I was expecting Restart=always
to respawn the system if it is powered off or rebooted (from within the container) or otherwise crash.
I was wondering if the reason is not because systemd
sees a shutdown
/ poweroff
as the equivalent of a systemctl stop
? If this is the case - is there a way to change this behaviour?
Otherwise, is there anything else to setup to have it restart?
0 Answers