Some reports suggest that this only happens when a XV overlay has been used, so one solution might be to try and avoid using XV altogether, but that causes a pretty big performance hit.
Another solution is to use APM instead of ACPI as powermanager, but this would cause Speedstep to stop working.
Some kernels >2.6.13 has ACPI shutdown fixed, but it was later broken in following kernel releases.
Since this issue will probably not be fixed, and since I've recently changed BIOS option to fixed speed fans, this issue is even more annoying than before, since the fans will keep spinning after shutdown. Thus inspired by Tom Wrights hack below, I decided to make a slightly less ugly, and slightly faster workaround using GRUB.
The idea is to keep ACPI support in the kernel and XV support in X, and just use GRUB to actually power off.
First make sure you have a recent version of GRUB installed:
grub-install /dev/sda(change /dev/sda to whereever your bootloader should be installed)
Make sure you're using "default saved" in your /boot/grub/menu.lst
Next add a new entry to /boot/grub/menu.lst above all other boot entries as follows:
title Shutdown root (hd0,0) savedefault 1 cat /grub/default halt(If you don't have a seperat boot partition use "cat /boot/grub/default" instead) (Recent versions of grub have a bug which fails to flush buffers to disk before the halt command is executed. Reading the file grub uses to store the default data forces it to be flushed to disk)
Now the final thing to do is is change you shutdown script from calling shutdown -h now to instead read:
grub-set-default 0 && shutdown -r now(I use irexec from lirc to shutdown, but if you use an acpi event, you should probably change /etc/acpi/powerbtn.sh)
[Tom Wright]: I have debian unstable, with a 2.6.16 kernel and the board doesn't power off properly. Any suggestions? It seems to power off easily if I do it soon after starting up, but not after I've done some things. I've a suspicion that it's playing a video through an XV overlay that causes problems but haven't proved this exhaustively.
[4296916.989000] setitimer: hcid (pid = 2580) provided invalid timeval it_value: tv_sec = 0 tv_usec = 5000000 [4296917.112000] setitimer: hcid (pid = 2580) provided invalid timeval it_interval: tv_sec = 0 tv_usec = 5000000 [4296923.704000] printk: 8 messages suppressed. [4296934.910000] Synchronizing SCSI cache for disk sdd: [4296934.977000] Synchronizing SCSI cache for disk sdc: [4296935.045000] Synchronizing SCSI cache for disk sdb: [4296935.112000] Synchronizing SCSI cache for disk sda: [4296935.183000] Power down. [4296935.220000] acpi_power_off called [4296935.220000] hwsleep-0283  enter_sleep_state : Entering sleep state [S5]
I'll try to get a log from a succesfull shutdown once I have a little more time on my hands to see if there is any difference.
[Tom Wright]: I've now upgraded to kernel 2.6.18 and it still won't shut down. That was without displaying an XV overlay too - I started it up, messed around with the sound modules (see other page!) and shut it down again. Any clues, anyone?
[Tom Wright]: Workaround found for shutdown issue
This is a *really* messy hack, but it does work.
In /etc/acpi/powerbtn.sh, put this (instead of '/sbin/shutdown -h now'):
touch /etc/buggymotherboard/pleaseshutdown /sbin/shutdown -r now
In /etc/rc.local, put this (in addition to anything else you may have in there):
BMDIR=/etc/buggymotherboard touch --date="`date --date="3 minutes ago"`" $BMDIR/comparison if [[ "$BMDIR/pleaseshutdown" -nt "$BMDIR/comparison" ]] ; then rm -f $BMDIR/pleaseshutdown $BMDIR/comparison shutdown -h now else rm -f $BMDIR/pleaseshutdown $BMDIR/comparison fi
See debian bug report for other posible workarounds: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=390547