Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-28-2005, 11:45 PM   #1
LQ Newbie
Registered: Jul 2005
Distribution: Debian (and others)
Posts: 19

Rep: Reputation: 0
"echo 3 > /proc/acpi/sleep" does nothing - ??

I'm guessing this is the wrong forum, but I don't know which one would be better, so...

I'm trying to get my computer to go to sleep, so that it's dark/silent at night (dark is key; too many case lights ). I'm dual-booting Windows / Debian Sarge; "Standby" in Windows does exactly what I want. When the machine's up, though, it's usually running Linux, so that doesn't help much...

I don't know too much about power saving on linux, but from what I've googled, it looks like I want ACPI level S3. Apparently, the way to do this is 'echo 3 > /proc/acpi/sleep' (I've also seen 'echo "S3" > /proc/acpi/sleep'; I've tried both). When I do this, though, nothing happens. 'echo 3 > /proc/acpi/sleep' has exactly the same effect as 'echo 3 > /dev/null'.

I have installed acpid and acpi. I'm running a kernel compiled from the sources, because the stock Debian kernel didn't support my SATA hard disk. When I compiled this kernel, I compiled in all ACPI options, other than the assorted Laptop Extras (this is a desktop), Debug Statements, and * Container Driver (EXPERIMENTAL). I compiled a few APM options as modules; none of those modules appear to be loaded.

I'm running a Pentium D processor on an Intel 955X-based motherboard, with an NVidia graphics card and proprietary drivers (sorry folks, need UT2004 at decent framerates...), if that matters. rmmod'ing the nvidia module doesn't seem to help.

Any thoughts?
Old 07-30-2005, 06:50 PM   #2
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
When you are going into suspend or sleep mode, you will have to first stop cron and syslog.

The setting S3 is Suspend to RAM, so I think it is still experimental. Use can S1 (power-on suspend) state instead. IMHO, desktop computers should not be set in suspend mode because it is glitchy at times. I did not add suspend feature in my kernel.

The LED lights can easily be turn off by a mechnical switch (aka a toggle switch). Also electrical tape can be used to hide the light. To minimize the noise, look into noiseless components like heatpipe and water cooling.
Old 07-30-2005, 10:35 PM   #3
LQ Newbie
Registered: Jul 2005
Distribution: Debian (and others)
Posts: 19

Original Poster
Rep: Reputation: 0
I tried stopping cron and syslog; I'd read that some programs might cause problems with suspend, but I didn't know which ones. Would they actively prevent the system from going into a Suspend mode, or would they just break on resume?

I also tried S1; I hadn't tried it before. It's not what I really want, but it'd be better than nothing. Unfortunately, it doesn't work, either. In the following code block, the first two commands exited after a moment of processing; the rest exited instantly, and caused no response (system didn't enter any kind of low-power mode, as far as I could tell):

arctic:/etc/init.d# ./cron stop
Stopping periodic command scheduler: cron.
arctic:/etc/init.d# ./sysklogd stop
Stopping system log daemon: syslogd.
arctic:/etc/init.d# echo 1 > /proc/acpi/sleep
arctic:/etc/init.d# echo "1" > /proc/acpi/sleep
arctic:/etc/init.d# echo "S1" > /proc/acpi/sleep
arctic:/etc/init.d# echo S1 > /proc/acpi/sleep
arctic:/etc/init.d# echo 3 > /proc/acpi/sleep
arctic:/etc/init.d# echo "3" > /proc/acpi/sleep
arctic:/etc/init.d# echo "S3" > /proc/acpi/sleep
arctic:/etc/init.d# echo S3 > /proc/acpi/sleep
By the way, which version of the "echo" command above should be correct? (echo n, echo "n", echo Sn, echo "Sn") Should it matter?

I have put electrical tape on some of the LEDs; the problem is that one is in the power supply, behind the cooling fan, so I can't really do anything to it easily. Also, I'm too cheap to spend too much on cooling, but all fans in the system are variable-speed and very quiet at low speeds, so if I killed all system-intensive apps it'd be quiet enough. I'd rather not kill anything, though; if I have to kill too much stuff, I might as well just shut down.

"Suspend" in Windows does work very reliably on this machine, so I'd think that the computer can do S3 (I assume that's what Windows is doing) without being glitchy. Maybe the Linux support is still experimental so it won't work well, but it'd be nice to at least give it a try.
Old 08-01-2005, 12:10 AM   #4
LQ Newbie
Registered: Jul 2005
Posts: 21

Rep: Reputation: 15
Most device drivers aren't yet able to cope with ACPI sleep. Try compiling a kernel with all drivers as modules instead of compiled-in (choose M instead of Y when configuring the build). Then you can remove them all (modprobe -r <module_name>). After that, try your sleep command again. If it works (don't hold your breath) then you could try putting them back one by one, to see which causes the problem. "echo -n 3 > /proc/acpi/sleep" Works For Me (tm).

Otherwise, APM might be your best option. Note that you can't have ACPI and APM active at the same time. From the ACPI kernel help: "If both ACPI and APM support are configured, whichever is loaded first shall be used.". So, best to compile a kernel without any ACPI support to make sure APM gets loaded.
Old 08-01-2005, 07:11 PM   #5
LQ Newbie
Registered: Jul 2005
Distribution: Debian (and others)
Posts: 19

Original Poster
Rep: Reputation: 0
I've tried a few more things, and done some more looking around online; here's what I've found:

- The Pentium D is a dual-core processor; I have SMP enabled to take advantage of this. I tried compiling with SMP disabled (no other changes); with this, and with all X instances stopped ("/etc/init.d/gdm stop") and the NVidia binary driver unloaded, the computer will go to sleep as expected. It just won't wake up properly. It won't react to keyboard key presses (normally wakes it up in Windows). If I push the "power" button, hard drives and fans spin back up, but the monitor doesn't display anything (still in power-saving mode, according to its LED), and the computer doesn't react to anything that I can think of. Switching VTs does nothing, CTRL-ALT-DEL on the (PS/2) keyboard does nothing, I can't ping the computer's IP address from another machine on the LAN.

S1 sleep does work correctly with SMP disabled. Is there really any advantage, though, to using S1 that I couldn't get by slowing the CPU way down (I can apparently decrease the frequency by up to 83%), setting the hard disks to spin down, and turning off all peripherals?

Does ACPI work properly on SMP systems? It looks like APM doesn't, and I'd rather have the extra CPU power than power-saving modes.

- I have two hard disks in this machine; both are SATA. This system has two onboard PATA chipsets, one with only one bus and one with the normal two. The second chipset (the one with two busses) isn't recognized (yet?) under Linux, and a DVD burner and SuperDisk drive fill the one recognized bus, so a PATA HD isn't an option right now. I saw somewhere online that SATA doesn't yet support power-saving; I looked around and found a kernel patch that someone had published that claimed to offer SATA power-management support. I applied the patch and re-compiled; it didn't help, though.
Old 08-02-2005, 11:53 AM   #6
LQ Newbie
Registered: Jul 2005
Posts: 21

Rep: Reputation: 15
Well, I don't know much about SMP, and I know nothing about SATA.

Two more ideas, which you might have tried:

1) On boot, my system gives this: (you can check with e.g. less /var/log/messages)

Aug 1 14:50:37 sagami kernel: ACPI wakeup devices:
Aug 1 14:50:37 sagami kernel: LID SLPB PCI0 UART PCI1 USB0 USB1 USB2 AC97
Aug 1 14:50:37 sagami kernel: ACPI: (supports S0 S3 S4 S5)

Fairly self explanatory: if your output is different, maybe it'll give you a clue.

Usually I use "SLPB" (SLeeP Button) to wake it up. This is a special button on my keyboard - the others don't bring it out of sleep.


This is a project for "Suspend to Disk", and it seems to be completely independent of ACPI. I.e. you completely power-down, but when you reboot, it restores an image from disk (like hibernate under windows). The version here seems to have more (but more experimental) features than that in the kernel. Also, their FAQ has a couple of articles on nVidia cards - maybe they'll give you a hint about what to do with ACPI. I haven't actually tried any of this.
Old 08-03-2005, 12:28 AM   #7
LQ Newbie
Registered: Jul 2005
Distribution: Debian (and others)
Posts: 19

Original Poster
Rep: Reputation: 0
I've looked somewhat, though not in depth, at both of these ideas. Here's what I've found:

Jul 31 09:23:39 localhost kernel: ACPI wakeup devices:
Jul 31 09:23:39 localhost kernel: P0P1 P0P3 P0P4 P0P5 P0P6 P0P7 P0P8 P0P9 PS2K PS2M UAR1 USB2 USB3 USB4 MC97 USB1 EUSB
Jul 31 09:23:39 localhost kernel: ACPI: (supports S0 S1 S3 S4 S5)

(this on an SMP kernel)

I don't have a special "Sleep" button anywhere, neither in hardware nor in the list. I don't have any idea what all of those wakeup devices actually are. Does anyone else know?; it'd be worth a try, and it'd be interesting to know. Also, are there any systemwide events, like plugging in a USB device, that should wake the computer? (would that be what the USBn devices are for?; this machine has 4 USB port pairs)

I tried Software Suspend 2; I was never able to get it to work, though. Essentially, it couldn't reread its own suspend data; it died with several error on reboot. It looks like Software Suspend 2 might need a PATA drive at present; there's a bunch of stuff on their site about SCSI being untested/unsupported. SATA isn't mentioned anywhere on their site, but on my system it appears to be more closely related to SCSI than to PATA (my main SATA HD is /dev/sda)... Anyone else with facts/experience here?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
what is "FRAG" in "/proc/net/sockstat" ? dileepkk Linux - Networking 1 06-21-2011 12:16 PM
What does echo alias "char-major-10-224 off" >> /etc/modules.conf do? abefroman Linux - Software 2 09-16-2009 11:10 PM
simple "echo > qbc" cron jobs doesn't run shole Linux - Newbie 3 09-23-2006 03:09 PM
(echo -n "standby" > /sys/power/state) only allowed for root? brynjarh Debian 5 02-14-2005 10:08 AM
Writing to "/dev/usb/hiddev*" and to "/proc/bus/usb/00B/00S" throw an arror EI stpg Programming 0 07-14-2004 06:44 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration