Bug 118291 - klaptopdaemon is not prepared for suspend2 via /proc/suspend2
Summary: klaptopdaemon is not prepared for suspend2 via /proc/suspend2
Status: RESOLVED UNMAINTAINED
Alias: None
Product: klaptopdaemon
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Paul Campbell
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-14 01:37 UTC by Manfred Paul
Modified: 2010-02-26 14:08 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manfred Paul 2005-12-14 01:37:49 UTC
Version:            (using KDE KDE 3.5.0)
Installed from:    Debian testing/unstable Packages
Compiler:          gcc (GCC) 4.0.3 20051201 (prerelease) (Debian 4.0.2-5) 
OS:                Linux

klaptop daemon is not able to suspend kernels with suspend2 (with new design)
suspend2 switch to /proc/suspend2. 

i am using debian sid with kernel 2.6.14.3 and software suspend2

here is my patch for this issue:

--- kdeutils-3.5.0.orig/klaptopdaemon/portable.cpp
+++ kdeutils-3.5.0/klaptopdaemon/portable.cpp
@@ -577,9 +577,10 @@
        if (known != last_seed) {
                known = last_seed;
                available = 0;
-               present = (((::access("/proc/sys/kernel/swsusp", F_OK) == 0) ||
-                            (::access("/proc/software_suspend", F_OK) == 0)) &&
-                          ::access("/usr/sbin/hibernate", F_OK) == 0);
+               present = (((::access("/proc/sys/kernel/swsusp", F_OK) == 0)  ||
+                            (::access("/proc/software_suspend", F_OK)  == 0)  ||
+                           (::access("/proc/suspend2", F_OK)          == 0)) &&
+                            ::access("/usr/sbin/hibernate", F_OK) == 0);
                if (present) {
                        if (::getuid() == 0) {  // running as root
                                available = ::access("/usr/sbin/hibernate", X_OK) == 0 && acpi_helper_ok(1);


make sure that klaptop checks this too.

mfg && by 

manne
Comment 1 Vesko Tomov 2006-02-09 21:48:05 UTC
Thanks for the patch, it worked for me.  I had to apply it again with KDE 3.5.1.  So the problem hasn't been fixed.

Vesko
Comment 2 Carsten Lohrke 2006-08-16 02:54:34 UTC
The fix is trivial and suspend2 kernels won't disappear in the foreseeable future. It would be nice, if this would be picked up.
Comment 3 Manfred Paul 2006-08-16 12:05:31 UTC
This fix is already includes. But kdelaptopdaemon needs another fix:

578,582c578,581
<       present = (((::access("/proc/sys/kernel/swsusp", F_OK) == 0)  ||
<                     (::access("/proc/software_suspend", F_OK ) == 0)  ||
<                     (::access("/proc/suspend2", F_OK         ) == 0)  ||
<                     (::access("/sys/power/suspend2", F_OK    ) == 0)) &&
<                      ::access("/usr/sbin/hibernate", F_OK)     == 0);
---
>       present = (((::access("/proc/sys/kernel/swsusp", F_OK) == 0) ||
>                             (::access("/proc/software_suspend", F_OK) == 0) ||
>                             (::access("/proc/suspend2", F_OK) == 0)) &&
>                  ::access("/usr/sbin/hibernate", F_OK) == 0);

regards

manne
Comment 4 Manfred Paul 2006-08-16 12:22:36 UTC
here is a patch against kde 3.5.4:

--- kdeutils-3.5.4.orig/klaptopdaemon/portable.cpp
+++ kdeutils-3.5.4/klaptopdaemon/portable.cpp
@@ -575,10 +575,11 @@
        if (known != last_seed) {
                known = last_seed;
                available = 0;
-               present = (((::access("/proc/sys/kernel/swsusp", F_OK) == 0) ||
-                            (::access("/proc/software_suspend", F_OK) == 0) ||
-                            (::access("/proc/suspend2", F_OK) == 0)) &&
-                          ::access("/usr/sbin/hibernate", F_OK) == 0);
+               present = (((::access("/proc/sys/kernel/swsusp", F_OK) == 0)  ||
+                    (::access("/proc/software_suspend", F_OK ) == 0)  ||
+                    (::access("/proc/suspend2", F_OK         ) == 0)  ||
+                    (::access("/sys/power/suspend2", F_OK    ) == 0)) &&
+                     ::access("/usr/sbin/hibernate", F_OK)     == 0);
                if (present) {
                        if (::getuid() == 0) {  // running as root
                                available = ::access("/usr/sbin/hibernate", X_OK) == 0 && acpi_helper_ok(1);
Comment 5 Carsten Lohrke 2006-08-22 20:53:17 UTC
Thanks, Manfred. Bug still open and I didn't had time to look at it yet, so I just left a message in hope someone picked it up. :) It's costly to fix these (sometimes trivial, e.g. Bug 126414) bugs multiple times downstream, while it could be done once upstream. Guess, it's the usual problem of not having enough active maintainers. :( There's also Bug 103437 open for more than 15 months, patch attached and 170 votes.
Comment 6 Stephan Wezel 2007-09-30 17:11:11 UTC
suspend2 has been renamed to tuxonice.Starting with version 2.2.10.3 
/sys/power/suspend2 has also been renamed to /sys/power/tuxonice
here is a slightly modified patch based on the patch from Manfred Paul which adds /sys/power/tuxonice 
to the check if software suspend is present.

 --- ./klaptopdaemon/portable.cpp.org    2007-09-30 16:14:48.000000000 +0200
+++ ./klaptopdaemon/portable.cpp        2007-09-30 16:21:56.000000000 +0200
@@ -577,7 +577,9 @@
                available = 0;
                present = (((::access("/proc/sys/kernel/swsusp", F_OK) == 0) ||
                             (::access("/proc/software_suspend", F_OK) == 0) ||
-                            (::access("/proc/suspend2", F_OK) == 0)) &&
+                            (::access("/proc/suspend2", F_OK) == 0) ||
+                           (::access("/sys/power/suspend2", F_OK) == 0) ||
+                           (::access("/sys/power/tuxonice", F_OK) == 0)) &&
                           ::access("/usr/sbin/hibernate", F_OK) == 0);
                if (present) {
                        if (::getuid() == 0) {  // running as root
Comment 7 Dario Andres 2010-02-26 14:08:15 UTC
I have personally contacted the KLaptopDaemon author/assigned and he confirmed that the tool is deprecated in KDE SC 4 (replaced by PowerDevil) and that there are no current efforts to support/maintain the KDE SC 3 version.
Because of this, I will close the reports as UNMAINTAINED.
Regards