[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
I spent a good long time tracking this down last night (gnome-power- manager uses hal to check. lshal says that hibernate is disabled. lshal was getting its information from /usr/bin/pmi which is part of the powermanagement-interface package). I have a single swap partition and the problem appears to be this line within pmi: hibernate) if grep -q ' /host fuse' /proc/mounts || \ swapon -s | tail -n +2 | awk '$2 == file { exit 1 }'; then result=1 Alas the file is not commented so it's not clear exactly what the intent of those lines is. But I'm assuming that it is trying to disable hibernate if you are using fuse or (that's the ||) if you are using swap to a file. The problem is that I think the logic is inverted. The swapon -s | tail -n +2 | awk '$2 == file { exit 1 }' is the key to the issue. I think this takes the output of swapon -s, skips the first line and then searches the rest for the parameter file in field 2 (the type) and returns 1 if it found and 0 otherwise. By contrast, if the grep command finds what you are looking for then it returns 0, if it cannot find what you are looking for then it returns 1. Shells generally interpret truth as 0 and anything but 0 as false. The above swapon snippet returns false if it thinks you have a swap file causing it to take the first branch on systems that DON'T have swap files. Thus I think it will return that hibernate is not possible on systems without swap files. (So a quick fix is to remove the swapon check. Alternatively you can fix up the logic using variables to store intermediary values to make things more obvious) -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Sitsofe, I tend to agree with your analysis. You can see above I have suspicions about that change, but as you say, without comments it is hard to discern the intent. I emailed Colin Watson earlier since he appears to have committed the change to get his input. I suspect this is a 'simple' logic error in the script, or unexpected results, and can be easily corrected. -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
I'm her to report +1: Toshiba satellite p205, using swap partition (2xRAM). Hibernate button missing, suspend broken. Resuming from suspend restarts X (forces login screen). Before the update both the hibernate and resume used to work pretty much OK. -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
@TDB Your last problem is another bug, which is already fixed: https://bugs.launchpad.net/ubuntu/+source/acpi-support/+bug/136453 -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Sitsofe Wheeler's analysis in https://bugs.launchpad.net/ubuntu/+source /powermanagement-interface/+bug/136433/comments/10 is spot-on. I'll fix this straight away. ** Changed in: powermanagement-interface (Ubuntu) Assignee: TJ = Colin Watson Status: New = Confirmed ** Changed in: powermanagement-interface (Ubuntu) Status: Confirmed = Fix Released -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
powermanagement-interface (0.3.17) gutsy; urgency=low * pmi.acpi: Fix inverted swap file logic (thanks, Sitsofe Wheeler; LP: #136433). Add some comments for good measure. -- Colin Watson [EMAIL PROTECTED] Sat, 01 Sep 2007 16:18:16 +0100 -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Since running the same updates, suspend also fails to resume (goes to a blank screen). I'm also missing the hibernate option in the shutdown menu. I'm running a Toshiba Satellite M30-001 -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
They are different, because the disapper of those buttons was after upgrading the package powermanagement-interface from 0.3.15ubuntu1 to 0.3.16 The button in the shutdown-menu, and the menu-item in the powermanagement systray-icon, are gone. I could not downgrade the version, because there is only this new version left in the repository. But after removing this package (powermanagement-interface), the button reappears (after reboot). ** Changed in: powermanagement-interface (Ubuntu) Sourcepackagename: None = powermanagement-interface -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Hmmm, I'm not entirely sure what most of that means. Could anyone translate into laymans terms? -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
According to the package's debian/changelog: powermanagement-interface (0.3.16) gutsy; urgency=low * pmi.acpi: Disable suspend and hibernate if /host is mounted via fuse; disable hibernate if a swap file is active. -- Colin Watson [EMAIL PROTECTED] Wed, 29 Aug 2007 18:40:49 +0100 A diff shows: diff -ru powermanagement-interface-0.3.15/debian/changelog powermanagement-interface-0.3.16/debian/changelog --- powermanagement-interface-0.3.15/debian/changelog 2007-04-10 23:09:35.0 +0100 +++ powermanagement-interface-0.3.16/debian/changelog 2007-08-29 18:40:52.0 +0100 @@ -1,3 +1,17 @@ +powermanagement-interface (0.3.16) gutsy; urgency=low + + * pmi.acpi: Disable suspend and hibernate if /host is mounted via fuse; +disable hibernate if a swap file is active. + + -- Colin Watson [EMAIL PROTECTED] Wed, 29 Aug 2007 18:40:49 +0100 + +powermanagement-interface (0.3.15ubuntu1) gutsy; urgency=low + + * Build for lpia. + * Set Ubuntu maintainer address. + + -- Matthias Klose [EMAIL PROTECTED] Fri, 24 Aug 2007 01:39:22 + + powermanagement-interface (0.3.15) feisty; urgency=low * gdm-signal/gdm-logout-action.c: diff -ru powermanagement-interface-0.3.15/debian/control powermanagement-interface-0.3.16/debian/control --- powermanagement-interface-0.3.15/debian/control 2005-03-22 22:45:54.0 + +++ powermanagement-interface-0.3.16/debian/control 2007-08-24 02:39:22.0 +0100 @@ -1,7 +1,8 @@ Source: powermanagement-interface Section: admin Priority: optional -Maintainer: Thom May [EMAIL PROTECTED] +Maintainer: Ubuntu Core developers [EMAIL PROTECTED] +XSBC-Original-Maintainer: Thom May [EMAIL PROTECTED] Build-Depends: debhelper (=4.1.16), libglib2.0-dev, libgtk2.0-dev, libxau-dev Standards-Version: 3.6.1.0 diff -ru powermanagement-interface-0.3.15/debian/rules powermanagement-interface-0.3.16/debian/rules --- powermanagement-interface-0.3.15/debian/rules 2006-03-20 06:34:39.0 + +++ powermanagement-interface-0.3.16/debian/rules 2007-08-24 02:38:30.0 +0100 @@ -3,7 +3,7 @@ DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) # good known arches go up here -ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), i386 amd64 ia64)) +ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), i386 amd64 ia64 lpia)) TYPE := acpi pmtool-depends := -V'pmtool:Depends=acpi-support (= 0.17)' endif diff -ru powermanagement-interface-0.3.15/pmi.acpi powermanagement-interface-0.3.16/pmi.acpi --- powermanagement-interface-0.3.15/pmi.acpi 2007-03-06 15:23:19.0 + +++ powermanagement-interface-0.3.16/pmi.acpi 2007-08-29 18:40:44.0 +0100 @@ -22,14 +22,19 @@ [ ! -z $1 ] event=$1 case $event in suspend|sleep) -if [ $ACPI_SLEEP = true ]; then +if grep -q ' /host fuse' /proc/mounts; then +result=1 +elif [ $ACPI_SLEEP = true ]; then result=0 else result=1 fi ;; hibernate) -if [ $ACPI_HIBERNATE != true -o -f /var/run/do-not-hibernate ]; then +if grep -q ' /host fuse' /proc/mounts || \ + swapon -s | tail -n +2 | awk '$2 == file { exit 1 }'; then +result=1 +elif [ $ACPI_HIBERNATE != true -o -f /var/run/do-not-hibernate ]; then result=1 else result=0 -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
The excerpt from the changelog quoted above explains it: powermanagement-interface (0.3.16) gutsy; urgency=low * pmi.acpi: Disable suspend and hibernate if /host is mounted via fuse; disable hibernate if a swap file is active. -- Colin Watson [EMAIL PROTECTED] Wed, 29 Aug 2007 18:40:49 +0100 Try $ grep ' /host fuse' /proc/mounts If there is an entry matching that, the changes shown above will cause suspend and hibernate to be disabled. ** Changed in: powermanagement-interface (Ubuntu) Assignee: (unassigned) = TJ -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Thanks for your reply. I tried: $ grep ' /host fuse' /proc/mounts I didn't get a result. Any more ideas? -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Ben - I've added you to this bug so you can comment on the interpretation of the changelog entry here. The 2nd line of the changelog entry says disable hibernate if a swap file is active. I'm not sure precisely what is meant by 'active' though. It could mean 'if a swap file rather than a swap partition is being used', or it might mean 'if part of the swap space is in-use' (hibernate saves it's memory image to the swap space, so if there's some in use the possibility of hibernate writing over it needs to be prevented). If Ben can tell us that we can test if that is the reason for the issue. -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Ooops!! I can't read - sorry Ben, I somehow got you confused with Colin Watson whilst juggling one too many bugs at once! I'll pass this onto Colin, and see if I can unsubscribe Ben, otherwise he'll have to do it himself :) -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 136433] Re: Hibernate missing from shutdown menu after 30/08/07 updates
Hmm, I think I'm using a swap partition as opposed to a file. I specifically made it twice my system memory for hibernation purposes too. I don't know if that info is of use to you. Would it be worth trying a separate partition specifically to hibernate to? -- Hibernate missing from shutdown menu after 30/08/07 updates https://bugs.launchpad.net/bugs/136433 You received this bug notification because you are a member of Ubuntu Bugs, which is the bug contact for Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs