ACPI-Shutdown doesn't work on debian

Discussions about using Linux guests in VirtualBox.
Post Reply
tY Software
Posts: 15
Joined: 25. Aug 2013, 19:07

ACPI-Shutdown doesn't work on debian

Post 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'.
Last edited by tY Software on 30. Aug 2013, 22:20, edited 1 time in total.
tY Software
Posts: 15
Joined: 25. Aug 2013, 19:07

Re: ACPI-Shutdown doesn't work on debian

Post 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?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: ACPI-Shutdown doesn't work on debian

Post 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.
tY Software
Posts: 15
Joined: 25. Aug 2013, 19:07

Re: ACPI-Shutdown doesn't work on debian

Post by tY Software »

OK, thanks for your response!
abighairyspider
Posts: 1
Joined: 17. Jun 2017, 11:06

Re: ACPI-Shutdown doesn't work on debian

Post 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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: ACPI-Shutdown doesn't work on debian

Post 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.
Post Reply