Fedora Linux Support Community & Resources Center
  #1  
Old 30th September 2005, 12:58 AM
dedded Offline
Registered User
 
Join Date: Jul 2005
Posts: 50
how to sleep/suspend on desktop?

I've searched through these forums, and on Google, for instructions on how to suspend my system, which is a desktop and not a laptop.

The only instructions I've found have been for laptops, and I haven't been able to get them to work on my system at all.

I'd like to be able to suspend to RAM (and/or disk, but RAM especially) with FC4 on my desktop. I don't want to have to boot my system each night, and I don't like the idea of burning all that electricity through the workday and the night (and most of most evenings) when I'm not using the machine.

So,
- Is suspend possible with FC4 on a desktop?
- Do I need something not available through core or extras?
- How do I do it?

Any help greatly appreciated.

/Dan
Reply With Quote
  #2  
Old 4th October 2005, 11:02 AM
kenm_uk Offline
Registered User
 
Join Date: Jul 2005
Location: London
Posts: 87
Dan,
Did you see the following post? I found it useful...
http://fedoraforum.org/forum/showthr...hlight=suspend

But now I am trying to figure out how to have the machine automatically wake up at a certain time...if you find anything please post it.

Ken

Last edited by kenm_uk; 4th October 2005 at 11:23 AM.
Reply With Quote
  #3  
Old 4th October 2005, 01:45 PM
scoon Offline
Registered User
 
Join Date: Apr 2005
Location: philadelphia, pa
Posts: 174
Hey there,

Good luck on your search. The reason that you are finding more info on lappys is that they do not have unlimited power like a desktop does. There is usually no reason to sleep a desktop. Which leads into my next question: Why do you need to do this ?

regards,

scoon
Reply With Quote
  #4  
Old 4th October 2005, 02:29 PM
kenm_uk Offline
Registered User
 
Join Date: Jul 2005
Location: London
Posts: 87
Scoon,

Thanks for your reply. The reason I want to sleep my server is that I do not want to run it 24/7 because it would be a waste of power and wear on the machine. I use it to host a multiplayer game which I want to play only in the evenings from a remote location. So I am trying to figure out how to get the box to sleep until 7pm and then start up to serve the multiplayer game.

Anyway, I think I have found the solution:
echo YYYY-MM-DD HH:MM:SS > /proc/acpi/alarm
and then sleep the machine with
echo "mem" > /sys/power/state

I tried it once and it put my server to sleep and woke it up on time. What would be a bit more ideal is if I could somehow wake it remotely on demand. Like Wake-on-LAN. but I don't think I can do this through a DSL-604+ router over the internet.

If you have any thoughts or recommendations please share.

Cheers,
Ken
Reply With Quote
  #5  
Old 4th October 2005, 03:02 PM
brandor Offline
Registered User
 
Join Date: May 2005
Posts: 534
Have you thought about setting up a cron job? Maybe have it run the commands you listed above at 3 in the morning or something? That way it wouldn't be running all day and would give you plenty of time to play your game.
Reply With Quote
  #6  
Old 4th October 2005, 07:57 PM
kenm_uk Offline
Registered User
 
Join Date: Jul 2005
Location: London
Posts: 87
brandor,

Thanks for your reply. A cron job would do the trick for adding the next alarm time to the alarm folder and then running the suspend command. I am just a bit too new to Linux to have worked out how to write my own scripts. Any thoughts on where I could find such a script? Basically all I need it to do is to put in today's date with the time 19:00 in the alarm file and then run the echo "mem > /sys/power/state command to be run by cron at 3am. BUT...if I happen to be using my server at 3am (either locally or remotely) it would be nice to see a warning which would allow me to abort the shutdown.

Anyway that is TOO MUCH for me to do now. But if you could recommend a good book or site on how to write a script that would be much appreciated.

Cheers,
Ken
Reply With Quote
  #7  
Old 5th October 2005, 03:28 AM
dedded Offline
Registered User
 
Join Date: Jul 2005
Posts: 50
This command does absolutely nothing on my machine:
echo "mem" > /sys/power/state

At least nothing that I can observe. It certainly doesn't put it to sleep. I assume this is all system-dependent. I'm on a Dell 4600 (ICH5-based) running FC4.

To answer another's post, I want to suspend my desktop to save power. Shutting down and later rebooting would also save power, but it's very inconvenient. Of course it's a bigger issue on a laptop, but it's still relevant for desktops.

/Dan
Reply With Quote
  #8  
Old 5th October 2005, 09:10 AM
kenm_uk Offline
Registered User
 
Join Date: Jul 2005
Location: London
Posts: 87
Dan,

I am just a newbie so not sure if I'll be of much help. I'll tell you what I have read and maybe oters will comment.

First, I think your motherboard must be acpi compatible (which I believe yours is). Second, it may need to be enabled in the BIOS settings. Third, you may need to be running the acpid deamon (not sure).

I found the following site of use:
http://acpi.sourceforge.net/

Ken
Reply With Quote
  #9  
Old 5th October 2005, 12:56 PM
dedded Offline
Registered User
 
Join Date: Jul 2005
Posts: 50
> First, I think your motherboard must be acpi compatible (which I believe yours is).

I believe so, too. Both suspend to RAM and suspend to disk work on Windows XP.

> Second, it may need to be enabled in the BIOS settings.

Well, works in Windows. Same BIOS.

> Third, you may need to be running the acpid deamon (not sure).

That's definitely running.

Thanks for the site, I'll check it out.

/Dan
Reply With Quote
  #10  
Old 6th October 2005, 04:15 AM
GrayFox Offline
Registered User
 
Join Date: Sep 2005
Posts: 434
This works on my HP DV4000....

Here is some code that works on my HP DV4000.
I was having problems with the screen not "waking up" after
a suspension, but I found (quite by accident) that changing
the console to a straight text console and then back to the
X console that the video would come back on...

Jerry

[jerry@localhost ~]$ more standby.c
// standby.c

// Author: Jerry LeVan
// Date: Sept 9,2005
// Build: make standby
// Env: HP DV4000, Fedora Core 4, a reasonable version of acpi
// Build: make standby
// sudo chown root standby
// sudo chmod u+s standby

// A short program to put the laptop
// to sleep. Toggling the door switch
// or hitting a key will awake the computer.

#include <unistd.h>
#include <stdlib.h>

int main (int argc , char** argv)
{
char * cmd = "/bin/sh" ;
char * theOpt = "-c";
char * theArg =
"sync;sync; /sbin/modprobe -r uhci_hcd ehci_hcd ; \
echo mem > /sys/power/state ; \
/sbin/modprobe uhci_hcd ; /sbin/modprobe ehci_hcd ; \
chvt 1 ; chvt 7 ; /sbin/ifup eth1 ; /usr/sbin/anacron -s ";


// the setuid will ensure that the exec'ed shell will run as root
setuid(0);

// Get the ball rollin...
int status=execl(cmd,cmd,theOpt,theArg,NULL);

(void)exit(0);

}
Reply With Quote
  #11  
Old 7th October 2005, 02:16 AM
kenm_uk Offline
Registered User
 
Join Date: Jul 2005
Location: London
Posts: 87
I am trying to get my machine to wake at a particular hour (say 8pm). I used:
echo 2005-10-(*DATE*) 20:00:00 > /etc/acpi/alarm
which seemed to work once or twice a few days ago but is no longer waking my server at the designated time.
Does anyone know what the problem might be?

Cheers,
Ken

P.S. I read something about how rebooting the machine affects the RTC which causes the alarm not to wake the system. But I did not quite understand what they meant or if that is affecting me.
Reply With Quote
  #12  
Old 7th October 2005, 06:19 PM
GrayFox Offline
Registered User
 
Join Date: Sep 2005
Posts: 434
Quote:
Originally Posted by kenm_uk
I am trying to get my machine to wake at a particular hour (say 8pm). I used:
echo 2005-10-(*DATE*) 20:00:00 > /etc/acpi/alarm
which seemed to work once or twice a few days ago but is no longer waking my server at the designated time.
Does anyone know what the problem might be?

Cheers,
Ken
Hi Ken,

Where did you find the doc that echoing the date/time to /etc/acpi/alarm would
awake the machine?

I can do this on my MacOS X machine ( using the power manager) but have not
been able to figure out how to set a wakeup call in FC4.

Thanks,

Jerry
Reply With Quote
  #13  
Old 8th October 2005, 02:33 AM
kenm_uk Offline
Registered User
 
Join Date: Jul 2005
Location: London
Posts: 87
GrayFox,
I think that "/etc/acpi/alarm" may have been a typo. My previous post read "/proc/acpi/alarm". I will try that and see if my machine wakes on time. Will let you know.

Ken
Reply With Quote
  #14  
Old 8th October 2005, 05:30 AM
Firewing1 Offline
Registered User
 
Join Date: Dec 2004
Location: Canada
Age: 23
Posts: 9,224
Hey,
I have the same problem as in the old post. echo "mem" just sounds like it shuts down the harddrives. Nothing happens. Right away, screen goes blank, and HD's shut off. Not much time to save everything to memory... Anyway, when I hit the power button again, my CRT monitor won't come back on even though the computer will. I use a Dell and i can standby in XP so i know it works...
Firewing1
__________________
[+] My open source software and blog
[+] Some of my howtos: (for full list, click here)

Last edited by Firewing1; 1st September 2006 at 09:49 PM.
Reply With Quote
  #15  
Old 8th October 2005, 12:22 PM
kenm_uk Offline
Registered User
 
Join Date: Jul 2005
Location: London
Posts: 87
Firewing1,
By "mem" I think that the machine goes to sleep and stores everything in the RAM. Since everything already is in the RAM there is not much for it to do. My machine shuts off the fans, hard drives, and the only sign that it is still somewhat on is that the power light blinks (indicating it is asleep).

When I wake the machine, I am also having difficulty getting it to restart my USB mouse/keyboard and to start up my monitor (on a Nvidia card). I may have found a solution to the USB problem, but am still having problems with the video issue.

But I am just a newbie trying to figure this out as I go along. Let me know what/if you find.

Ken
Reply With Quote
Reply

Tags
desktop, sleep or suspend

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sleep/Suspend/Hibernate chrisndebb Using Fedora 2 4th June 2006 05:38 AM


Current GMT-time: 09:34 (Friday, 24-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Mount Pleasant Photos on Instagram - Domont Photos - Dharmadam Photos