I am configuring a server connected to an UPS.
The UPS is managed via apcupsd
and it calls some scripts when there is a power outage and when the situation goes back to normal.
The server is running serveral virtual machines that are launched by the user vboxuser
.
I'd like to gracefully stop the virtual machines when there is a power outage and I can do that running vboxmanage
.
How can I run the command as vboxuser
from the scripts called by apcupsd
?