Browse Source

Add vmctl stop -a [-fw] option to stop or terminate all running VMs.

This is also be used to simplify the vmd rc stop script.
OK mlarkin@ ccardenas@
OPENBSD_6_4
reyk 6 years ago
parent
commit
8658c763c0
1 changed files with 2 additions and 9 deletions
  1. +2
    -9
      src/etc/rc.d/vmd

+ 2
- 9
src/etc/rc.d/vmd View File

@ -1,6 +1,6 @@
#!/bin/ksh
#
# $OpenBSD: vmd,v 1.8 2018/07/11 13:19:47 reyk Exp $
# $OpenBSD: vmd,v 1.9 2018/09/27 17:15:36 reyk Exp $
daemon="/usr/sbin/vmd"
@ -11,15 +11,8 @@ rc_pre() {
${daemon} -n ${daemon_flags}
}
list_running() {
vmctl status | awk '$2 ~ "[0-9]" {print $8}'
}
rc_stop() {
for vm in $(list_running); do
_rc_do vmctl stop "$vm" -w
done
_rc_do vmctl stop -a -w
pkill -T "${daemon_rtable}" -xf "${pexp}"
}


Loading…
Cancel
Save