#5683 new enhancement
Configurable actions on signals
回報者: | ae3265 | 負責人: | |
---|---|---|---|
元件: | VM control | 版本: | VirtualBox 3.1.0 |
關鍵字: | sigterm launchd osx | 副本: | |
Guest type: | other | Host type: | Mac OS X |
描述
Please see my last post in this thread for background:
http://forums.virtualbox.org/viewtopic.php?f=8&t=24244&p=114221#p114221
In OS X, launchd uses SIGTERM to stop running processes. If VirtualBox trapped signals (SIGTERM, HUP, etc.), then launchd items could be created to cleanly shutdown running VM's for those of use using VB with headless mode with OS X in more of a "server" mode. I believe once the signals are trapped, that the launchd plists have sufficient options to deal with the time it takes to process various shutdown options.
Best would be to have a setting in VB that would allow user-configurable actions based on the signal received. For example, I might want HUP to suspend the VM and SIGTERM to run acpipoweroff...or HUP to acpipoweroff and SIGTERM to poweroff.
Ideally, this setting will be in the VM settings and work whether the VM is started with VBoxHeadless or from the GUI.
As it is, working around this without the capability to handle signals, particularly SIGTERM, with OS X's launchd leaves some doubt as to complete and clean shutdown of VM's upon system reboot/shutdown.
I'm more than happy to help out with testing under 10.5/10.6 on my lab machines. Thanks!
Please add signal mapping to VBoxHeadless.
I would prefer the following mapping:
The argument is quite simple. SIGTERM is a more universal signal, that maps to a more universal action. USR? signals are by definition application specific, and the guest reaction to them is not easily predictable.