since I have changed from SuSE 7.3 to gentoo my system does not power off (after executing shutdown -h 0)... That's my main problem right now... (I have tried several kernels now with APM and with or without ACPI...)

My second problem is: 'poweroff' is an unknown command to my system. I'd like to install it - but which package in portage is to install?emerge -s "poweroff" doesn't find anything. Is poweroff only a synonym to shutdown -h 0 ?

halt -p / shutdow -h 0 do not power off the system. The last lines on my screen are:
... Unmounting filesystems ... Remounting remaining filesystems readonly ... Power off ... /sbin/rc: return: can only 'return'from a function or sourced script.

I think kanuslupus is right. There should be something in the kernel config around powering off with a busted BIOS (I check the helps in the power management section). My box wouldn't power it's self down until I add that to the kernel.

Yes, I've now compiled a lot of kernels with nearly any existing combination of ACPI on /off, APM on/off but the system still doesn't power off

halt -p, shutdown -h 0, ... do not work.

the system goes down, it says "power off", then the hard disk is switched off (but not the computer itself) and at the end of the shutdown tasks there is this strange message (I've mentionend above):
/sbin/rc: return: can only 'return'from a function or sourced script
What the hell does this stand for?

further information:
- I tried emerging and unmerging acpid and / or apmd
- I tried switching off ACPI in BIOS - not possible
- the computer was powerd off fine with SuSE7.3 and Windows

THIS was the solution! Thanks to all of the 80 readers and writers of these postings and especially to fghellar!

Here a short summary in my words to everybody with the same problem:
A mainboard supports ether ACPI or APM. Figure out what's the right for your board (the newer it is the more likely it is ACPI) and so don't compile your kernel with both options on but only the right one.