Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
hibernate cannot shut machine power off! [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
geeksheik
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2003
Posts: 99
Location: Zürich, Switzerland

PostPosted: Sat Jan 17, 2009 4:08 pm    Post subject: hibernate cannot shut machine power off! [solved] Reply with quote

Greetings All,

I'm struggling with TuxOnIce / Hibernate / Suspend2. Everything works fine except that the system does not power itself off at the end.

/sbin/poweroff (/sbin/halt) works fine to shut the power off, but the hibernate script cannot do it! I've had this installed through several kernel versions (2.6.23, when it was a patch, through 2.6.27). It's always had the same problem. Sometimes it's had additional problems as well.

I would think that the answer would be to edit /etc/hibernate/suspend2.conf, and set:
Code:
PowerdownMethod 0


I've also tried:
Code:
PowerdownMethod 5


Both yeild the same result. The discs spin down, drivers are unloaded, everything works fine, except the system does not shut it's own power off. I suppose I should just be happy that the system wakes up fine.

Any idea how I might remedy this situation?

Here is some relevant data:

Code:

-> uname -a
Linux vera 2.6.27-gentoo-r7 #5 SMP PREEMPT Fri Jan 16 21:12:21 CET 2009 i686 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ AuthenticAMD GNU/Linux

-> equery list hibernate-script
[I--] [  ] sys-power/hibernate-script-1.97-r4 (0)

-> equery list acpi
[I--] [  ] sys-power/acpi-0.06-r5 (0)
[I--] [  ] sys-power/acpid-1.0.6-r1 (0)

-> rc-update show | grep acpi
               acpid |      default


Thanks in advance,

Bryant


Last edited by geeksheik on Sat Jan 17, 2009 8:00 pm; edited 1 time in total
Back to top
View user's profile Send private message
geeksheik
Tux's lil' helper
Tux's lil' helper


Joined: 07 Sep 2003
Posts: 99
Location: Zürich, Switzerland

PostPosted: Sat Jan 17, 2009 8:00 pm    Post subject: Reply with quote

Finally!

This is the fix:
Code:

echo shutdown > /sys/power/disk


I wish I could have that 2 hours of my life back. I wasted hours digging through the sys-power/hibernate-script; the config files, the man pages and the source code! In the end, I found the answer in the kernel docs (/usr/src/linux/Documentation/power/interface.txt). It would be extremely useful if this interface was exposed through the hibernate-script conf files.

Since I spent so damn long with this, I'll provide an excessive bit of background:

Here is the previous setting:

Code:

cat /sys/power/disk
[platform] test testproc shutdown reboot


Maybe there's a bios config or a bios upgrade that I could do so that the "platform" setting would poweroff the box. I don't know.

Here's the code from hibernate-script that controls this. The installed location is: /usr/share/hibernate/scriptlets.d/sysfs_power_state

Code:

DoSysfsPowerStateSuspend() {
    if [ -z "$SYSFS_POWER_STATE_NO_SUSPEND" ] ; then
        vecho 1 "$EXE: Activating sysfs power state $USING_SYSFS_POWER_STATE ..."
        [ -n "$SYSFS_POWER_STATE_POWERDOWN_METHOD" ] && \
            [ -f "$SYSFS_POWERDOWN_METHOD_FILE" ] && \
            /bin/echo $SYSFS_POWER_STATE_POWERDOWN_METHOD > $SYSFS_POWERDOWN_METHOD_FILE
        /bin/echo -n $USING_SYSFS_POWER_STATE > $SYSFS_POWER_STATE_FILE
    else
        vecho 1 "$EXE: Not actually suspending (--no-suspend given)"
    fi
    return 0
}


I would expect that if:
Quote:
PowerdownMethod 0

is set in /etc/hibernate/suspend2.conf
then /sbin/hibernate should do a "halt / poweroff" command instead of using acpi via /sys/power

However, that's not the case.

I know, I know...I should be taking this up with the TuxOnIce guys. They're next...

Final note: I see that /sys/power/disk is reset to [platform] after a couple of reboots. I need to find the place to remove the code that resets that, or to hard-code that [shutdown] setting somewhere....
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum