Version: 1.4 (using KDE KDE 3.3.1) Installed from: Debian testing/unstable Packages Compiler: gcc 3.3 OS: Linux Suspend-to{disk|RAM} is currently mostly used from a script to workaround some glitches (like unloading incompatible drivers, switching to a textconsole e.g.). It seems though, that klaptopdaemon does not recognize that there's a script that has to do some work before the sleep-state is invoked and directly tells the kernel to get into said sleep state. That breaks systems on which the work to be done by the hibernate script is necessary. It worked for me pretty well in the first place, but for some time now, switching of VTs is not any more done by software suspend but has to be done in userspace. That broke klaptopdaemons 'hibernate' features. :( I'd very much appreciate an option to call a script instead of invoking the sleep state directly (the one used on most systems is called 'hibernate'), so I'll be able to choose the behaviour of the hibernate options. Otherwise klaptopdaemon is a great tool, thanks for it!
Hi. Sebastian didn't make it too clear, but he's referring to the suspend2 patches (softwaresuspend.berlios.de) when he talks about vt switching needing to be done from userspace. The implementation in the vanilla kernel will need userspace help with unloading modules too, so I want to support his plea for klaptopdaemon to run a script instead of directly echoing to /proc/acpi/sleep. Regards, Nigel
I'm back from my hiatus travelling the world and will soon be spending more time on klaptopdaemon (just need to do some simple things like find a house etc) - this has been on my list of things to do for a while
I second this feature request. klaptop(daemon) seems like a very useful application but this is something that unfortunately renders hibernate etc. unusable to me. There only needs to be a simple input thingy where you can define a "hibernate script". I'm voting here :)
Created attachment 9078 [details] Workaround proposal which runs a script instead of writing into /proc directly Attached patch fixes the problem for me, S3 and S4 work together properly with klaptopd. The patch changes the parts where /proc is written to directly to run a script. The scripts that are now called are: /usr/sbin/suspend for suspend-to-ram (S3) /usr/sbin/hibernate (S4) /usr/sbin/software-suspend (S4) (The latter two might be merged, though.) But ... this patch can break existing setups, since the scripts called might not be installed on systems where writing (1|3|4) into /proc/acpi/sleep actually works. The patch was kindly prepared by Thunfisch@thunfisch.org and applies cleanly to the version of klaptopd in 3.3.2 and current CVS.
CVS commit by adridg: Prefer scripts suspend or hibernate over direct access to /proc/acpi/sleep, as noted in the patch attached to the bug report. The patch has been munged somewhat, though. BUGS:93533 M +3 -0 acpi_helper.cpp 1.19 --- kdeutils/klaptopdaemon/acpi_helper.cpp #1.18:1.19 @@ -115,4 +115,6 @@ main(int argc, char **argv) for (i = 1; i < argc; i++) if (strcmp(argv[i], "--suspend") == 0 || strcmp(argv[i], "-suspend") == 0) { + /* Returns only if suspend does not exist. */ + run_program("/usr/sbin/suspend"); write_to_proc_sleep(3); exit(0); @@ -127,4 +129,5 @@ main(int argc, char **argv) } else if (strcmp(argv[i], "--hibernate") == 0 || strcmp(argv[i], "-hibernate") == 0) { + run_program("/usr/sbin/hibernate"); write_to_proc_sleep(4); exit(0);