Date: Thu, 25 Apr 2019 22:04:07 +0700 From: Victor Sudakov <vas@mpeks.tomsk.su> To: freebsd-virtualization@freebsd.org Subject: Re: [vm-bhyve] Windows 2012 and 2016 servers guests would not stop Message-ID: <20190425150407.GA62313@admin.sibptus.ru> In-Reply-To: <CAOb7DXEKEvKGejYDscVNf4T%2BTV7p-w0ZNC5jskLbk7s1YH2UmA@mail.gmail.com> References: <20190424043656.GA25754@admin.sibptus.ru> <201904240557.x3O5v6AK041737@gndrsh.dnsmgr.net> <20190424065223.GA28138@admin.sibptus.ru> <CAOb7DXEKEvKGejYDscVNf4T%2BTV7p-w0ZNC5jskLbk7s1YH2UmA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Stephen Stuart wrote: > I call this in /etc/rc.shutdown.local to shut all VMs down gracefully and > wait, perhaps a variant would help you. > > #!/bin/sh > > INTERVAL=5 > /usr/bin/killall -TERM bhyve > echo -n "/dev/vmm:" > while test -d /dev/vmm ; do > echo -n "" $(/bin/ls /dev/vmm | /usr/bin/wc -w) > /bin/sleep $INTERVAL > done > echo " 0" Thanks for reminding me about /etc/rc.shutdown.local. I've tested a solution today and it seems working. 1. Start apcupsd with --term-on-powerfail apcupsd_enable="YES" apcupsd_flags="--term-on-powerfail" 2. Put the following line into /etc/rc.shutdown.local test -f /var/run/powerfail && /usr/local/sbin/apcupsd --killpower Now, when the UPS power is exhausted, apcupsd starts the shutdown procedure and exits. The system shuts down without any haste, as it pleases, and at the very end "apcupsd --killpower" is called and poweroffs the UPS. -- Victor Sudakov, VAS4-RIPE, VAS47-RIPN 2:5005/49@fidonet http://vas.tomsk.ru/ [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJcwcxnAAoJEA2k8lmbXsY0BE8H/3qJrBBNaXzlOXsL99eLmBWT /MCKBJa0+l2AueDgNyO3YWa4aKGtYwQJI4PrZDme9QAGv8Ijs1xXvgdCanfaquF9 HRSoC0wAy19lASkIW82xt+TVz4iyFtrlMBWrlr14rTrvxjWb6cMfct5jW66Iykhb WSHd8auLweqkkc1damoE2lRKKVJbuWEUHLn7JZoTc/C3Gwlrwijo3iDPUX+UyWM5 F3IC3Mri/zRhvbwEuqx5kNdc72sztpCN7Gc/yvzqh/Wq7EJXrRY0HKE8VPfohEF8 /P0hlZOasraYaGAoWnlHd6Nc7QmFs6SoSm/2smsVFEhe+M0//y7TTuOuE10fTUw= =p07H -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190425150407.GA62313>
