nixos-module/server/lxc-containers: add restart on failed reload

This commit is contained in:
Astro 2021-05-01 03:04:14 +02:00
parent 3166d607f5
commit aa5c7377c7
1 changed files with 4 additions and 1 deletions

View File

@ -106,7 +106,10 @@ let
active=$(systemctl is-active lxc@$c)
if [[ "$active" = active ]] ; then
echo Activating $c
systemctl reload lxc@$c
systemctl reload lxc@$c || (
echo Reload failed. Restarting $c
systemctl restart lxc@$c
)
else
echo Starting $c
systemctl start lxc@$c