Page 1 of 1
ACPI-Shutdown doesn't work on debian
Posted: 28. Aug 2013, 23:03
by tY Software
Hi,
some hours ago I realized that I can't shutdown my vm with ACPI. I found many threads where the only answer is to install acpi and acpi-support. I already did this but it still doesn't work. When I try to run the command when screen is locked (without pw) the only reaction is that the vm "wakes up".
Does anybody know a solution for this?
Thanks in advance!
Edit:
This is an extract from the VM-logfile, being logged when I call acpipowerbutton:
02:29:08.990643 Changing the VM state from 'RUNNING' to 'SUSPENDING'.
02:29:09.325182 PDMR3Suspend: 334 468 957 ns run time
02:29:09.325208 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'.
02:29:10.565719 Changing the VM state from 'SUSPENDED' to 'RESUMING'.
02:29:10.566442 Changing the VM state from 'RESUMING' to 'RUNNING'.
Re: ACPI-Shutdown doesn't work on debian
Posted: 30. Aug 2013, 22:19
by tY Software
Ok, I got it (but don't really understand why)..
Unfortunately I'm fairly new to Linux, so I'm not very familiar with those shell scripts. The solution (which seems to be more a workaround) was to edit /etc/acpi/events/powerbtn-acpi-support.sh.
This is the default script:
if [ -f /etc/acpi/events/powerbtn -o -f /etc/acpi/events/powerbtn.dpkg-bak ] ; then
logger Acpi-support not handling power button, acpid handler exists at /etc/acpi/events/powerbtn or /etc/acpi/events/powerbtn.dpkg-bak.
exit 0
fi
[ -e /usr/share/acpi-support/policy-funcs ] || exit 0
. /usr/share/acpi-support/policy-funcs
if CheckPolicy; then
exit 0
fi
if [ -x /etc/acpi/powerbtn.sh ] ; then
# Compatibility with old config script from acpid package
/etc/acpi/powerbtn.sh
elif [ -x /etc/acpi/powerbtn.sh.dpkg-bak ] ; then
# Compatibility with old config script from acpid package
# which is still around because it was changed by the admin
/etc/acpi/powerbtn.sh.dpkg-bak
else
# Normal handling.
/sbin/shutdown -h -P now "Power button pressed"
fi
My solution was to remove all checks and just execute the essential part. My new file:
# Normal handling.
/sbin/shutdown -h -P now "Power button pressed"
But I really don't know what problems this could cause. Could someone give me a hint or tell me why exactly it doesn't work with the complete script?
Re: ACPI-Shutdown doesn't work on debian
Posted: 30. Aug 2013, 23:03
by Perryg
You would need to put this question to Debian I am afraid. Most Debian forks work with acpi but Debian has their own way of doing things. called the Debian way.
I can tell you that AFAIK it has nothing to do with VirtualBox.
Re: ACPI-Shutdown doesn't work on debian
Posted: 31. Aug 2013, 14:33
by tY Software
OK, thanks for your response!
Re: ACPI-Shutdown doesn't work on debian
Posted: 17. Jun 2017, 11:11
by abighairyspider
tY Software wrote:Ok, I got it (but don't really understand why)..
The solution (which seems to be more a workaround) was to edit /etc/acpi/events/powerbtn-acpi-support.sh.
My solution was to remove all checks and just execute the essential part. My new file:
Code: Select all
# Normal handling.
/sbin/shutdown -h -P now "Power button pressed"
But I really don't know what problems this could cause. Could someone give me a hint or tell me why exactly it doesn't work with the complete script?
Thanks, finding this just helped me. The reason my Debian 8 wasn't shutting down is that when the graphical interface is there, the script on my Debian 8 at /etc/acpi/powerbtn-acpi-support.sh was getting confirmation of the shutdown, I think. On ACPI power button, it would freeze up into some weird state until the next power button event and then go back to waiting for a login.
Your modification fixed it, just having the shutdown command without any of the before-hand logic.
Re: ACPI-Shutdown doesn't work on debian
Posted: 17. Jun 2017, 15:24
by mpack
Thanks for your contribution, but please bear in mind that this is the VirtualBox user forum, not the Debian support forum. Neither the problem nor the solution seem to have much to do with VirtualBox, i.e. the same problem could be encountered on physical hardware.