summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsthen <sthen@openbsd.org>2018-07-11 21:49:37 +0000
committersthen <sthen@openbsd.org>2018-07-11 21:49:37 +0000
commit84a736751c9aed1852a13bcc6dd2021e5c4467aa (patch)
treedd0c30757cf19a3a073bbfb8e3a8dcc733915df7
parentcheck string lengths in vm_start (diff)
downloadwireguard-openbsd-84a736751c9aed1852a13bcc6dd2021e5c4467aa.tar.xz
wireguard-openbsd-84a736751c9aed1852a13bcc6dd2021e5c4467aa.zip
Explicitly call "/etc/rc.d/vmd stop". This issues graceful shutdown commands
to running VMs (at least for OpenBSD ones), but the stop routine for system daemons is not usually called at shutdown. Earlier version with just "vmd stop" ok reyk@ kn@, ajacoutot@ reminded me to hide the contextless "vmd(ok)" text which looks bad, I did so and wrapped it with a "stopping VMs" message (it can take some time, especially when you have multiple VMs, so better to have some clear feedback).
-rw-r--r--etc/rc8
1 files changed, 7 insertions, 1 deletions
diff --git a/etc/rc b/etc/rc
index c8556565bfd..38a9ba57604 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.526 2018/07/11 08:31:48 florian Exp $
+# $OpenBSD: rc,v 1.527 2018/07/11 21:49:37 sthen Exp $
# System startup script run by init on autoboot or after single-user.
# Output and error are redirected to console by init, and the console is the
@@ -337,6 +337,12 @@ if [[ $1 == shutdown ]]; then
echo '.'
fi
+ if /etc/rc.d/vmd check > /dev/null; then
+ echo -n 'stopping VMs'
+ /etc/rc.d/vmd stop > /dev/null
+ echo '.'
+ fi
+
[[ -f /etc/rc.shutdown ]] && sh /etc/rc.shutdown
fi