Bug 118823 - Closing laptop lid interrupts shutdown
Summary: Closing laptop lid interrupts shutdown
Status: VERIFIED FIXED
: 157548 203470 (view as bug list)
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Mobile Devices (show other bugs)
Version: Beta 4
Hardware: i686 All
: P5 - None : Enhancement
Target Milestone: SUSE Linux 10.1
Assignee: Forgotten User ZhJd0F0L3x
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-26 15:48 UTC by Hugo Costelha
Modified: 2007-06-05 11:20 UTC (History)
2 users (show)

See Also:
Found By: Customer
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hugo Costelha 2005-09-26 15:48:01 UTC
Hi, 
 
I have my laptop configured to suspend-to-ram when I close the lid. 
If I am in KDE, I select shutdown the system starts to shutdown as expected. 
However, if I close the lid during the shutdown, the system suspends-to-RAM. 
As soon as I open the lid, the computer resumes and continues the shutdown. 
 
Although this shows that suspend is working, it is not the desired behaviour, 
since I had already instructed the computer to shutdown.
Comment 1 Dr. Werner Fink 2005-09-27 09:15:32 UTC
IMHO this exactly what you've instructed the computer.
Comment 2 Forgotten User ZhJd0F0L3x 2005-09-27 09:49:32 UTC
I will look into this to see if we can do something about this. We will need to
detect reliably if a shutdown is running and there will still be corner cases
(e.g. you select "shutdown" in kde, but kde first saves your documents etc, logs
you out and then shuts down the machine) that may lead to a similar problem, but
there is room for improvement.
Thanks for the suggestion!
Comment 3 Forgotten User ZhJd0F0L3x 2005-09-27 09:50:44 UTC
BTW: this is nothing easily solvable since it probably needs some infrastructure
changes, too. This is why i rated this as "enhancement", but i will think about
it and work to make it better.
Comment 4 Holger Macht 2005-09-27 09:54:47 UTC
We would have to detect if a shutdown is in progress. Any idea how we could do this?
Comment 5 Hugo Costelha 2005-09-27 09:56:07 UTC
Ok, thanks. 
Comment 7 Forgotten User ZhJd0F0L3x 2006-02-27 08:53:17 UTC
i commited the following fix to SVN:
Index: sleep_helper_functions
===================================================================
--- sleep_helper_functions      (revision 1950)
+++ sleep_helper_functions      (working copy)
@@ -336,6 +336,19 @@
     DEBUG "Stop services: $SERVICES_TO_RESTART" DEBUG
     DEBUG "Modules to unload: $MODULES_TO_UNLOAD" DEBUG

+    ####### first check if the machine is shutting down right now.
+    echo "== checking runlevel ==" >> $LSMOD_LOG
+    D=`runlevel`
+    case $D in
+        *0|*6)
+            echo "  system is shutting down or rebooting. Not suspending. '$D'" >> $LSMOD_LOG
+            notify "Shutdown or reboot in progress, not suspending." ERROR CONTINUE $EV_ID
+            progress_finish
+            $SCRIPT_RETURN $EV_ID 1 "Shutdown/reboot in progress, not suspending"
+            EXIT 1
+            ;;
+    esac
+    echo "  no shutdown/reboot in progress, good." >> $LSMOD_LOG
+
     ####### Check for devices which need to be remounted after suspend #######
     let PERCENT+=$STEP
     [ "$UNMOUNT_FATFS" == "yes" ] && unmount_fatfs "$1" "$EV_ID"


This should detect if the system is on its way to runlevel 6 (reboot) or 0 (shutdown) and refuse to suspend.
Comment 8 Holger Macht 2006-03-14 10:33:17 UTC
*** Bug 157548 has been marked as a duplicate of this bug. ***
Comment 9 Holger Macht 2006-03-14 10:34:46 UTC
We got another report that this does not work on Beta7.

Maybe when clicking "Logout" in the gnome logout dialog and immediately closing the lid, the system is not yet in runlevel 0 or 6. So this check fails.
Comment 10 Forgotten User ZhJd0F0L3x 2006-03-14 10:51:54 UTC
But there is not much we can do then without extensive interaction between the desktop environment and powersaved.
And we will not get this from GNOME.

BTW: i do not consider this a real bug. When i click "log out" and then get asked to save the settings (for example), but close the lid too early to notice the question, i'd like it to suspend and not waste my batteries waiting for me to answer the question ;-)

The bug is, that teh destop environments do not start the shutdown fast enough.
Comment 11 Forgotten User ZhJd0F0L3x 2006-07-03 15:25:16 UTC
i'd still consider this fixed, at least "as fixed as possible".
Comment 12 Forgotten User ZhJd0F0L3x 2006-09-12 13:19:33 UTC
*** Bug 203470 has been marked as a duplicate of this bug. ***