nixos-module/server/lxc-containers: add restart on failed reload
This commit is contained in:
parent
3166d607f5
commit
aa5c7377c7
|
@ -106,7 +106,10 @@ let
|
||||||
active=$(systemctl is-active lxc@$c)
|
active=$(systemctl is-active lxc@$c)
|
||||||
if [[ "$active" = active ]] ; then
|
if [[ "$active" = active ]] ; then
|
||||||
echo Activating $c
|
echo Activating $c
|
||||||
systemctl reload lxc@$c
|
systemctl reload lxc@$c || (
|
||||||
|
echo Reload failed. Restarting $c
|
||||||
|
systemctl restart lxc@$c
|
||||||
|
)
|
||||||
else
|
else
|
||||||
echo Starting $c
|
echo Starting $c
|
||||||
systemctl start lxc@$c
|
systemctl start lxc@$c
|
||||||
|
|
Loading…
Reference in New Issue