Use lxc-start/lxc-attach instead of lxc-execute, so the system is booted with systemd
This commit is contained in:
parent
52cfb26a3a
commit
700fc8ce33
13
bin/mkvm.sh
13
bin/mkvm.sh
|
@ -91,11 +91,18 @@ CMD="$1"
|
|||
shift
|
||||
|
||||
if [[ "$CMD" != "" ]]; then
|
||||
lxc-execute -n "$VMNAME" -- "$CMD" "$@"
|
||||
[ $KEEP -eq 0 ] && lxc-destroy -n "$VMNAME"
|
||||
lxc-start -n "$VMNAME"
|
||||
lxc-attach -n "$VMNAME" -- "$CMD" "$@"
|
||||
if [ $KEEP -eq 0 ]; then
|
||||
lxc-stop --kill "$VMNAME"
|
||||
lxc-destroy -n "$VMNAME"
|
||||
fi
|
||||
else
|
||||
lxc-start -n "$VMNAME"
|
||||
lxc-attach -n "$VMNAME" bash
|
||||
[ $KEEP -eq 0 ] && lxc-stop --kill "$VMNAME" && lxc-destroy -n "$VMNAME"
|
||||
if [ $KEEP -eq 0 ]; then
|
||||
lxc-stop --kill "$VMNAME"
|
||||
lxc-destroy -n "$VMNAME"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user