nixos-module/server/lxc-container: split container build and activation phases
This commit is contained in:
parent
9c63bd996f
commit
f7dabd8e2d
|
@ -122,8 +122,12 @@ let
|
|||
mkdir -p /var/lib/lxc/$c/rootfs/$d
|
||||
done
|
||||
ln -fs $SYSTEM/init /var/lib/lxc/$c/rootfs/init
|
||||
done
|
||||
|
||||
# Activate all the desired container after all of them are
|
||||
# built
|
||||
set +e
|
||||
for c in $@; do
|
||||
active=$(systemctl is-active lxc@$c)
|
||||
if [[ "$active" = active ]] ; then
|
||||
echo Activating $c
|
||||
|
@ -135,8 +139,8 @@ let
|
|||
echo Starting $c
|
||||
systemctl start lxc@$c
|
||||
fi
|
||||
set -e
|
||||
done
|
||||
set -e
|
||||
'';
|
||||
|
||||
enable-script = pkgs.writeScriptBin "enable-containers" ''
|
||||
|
|
Loading…
Reference in New Issue
Block a user