Ideas -> Suspend or Hibernate Idle machines

Members of energy conservation club visit workspace (common working area for first year UG students) and teaching labs (area where labs for courses are carried out) and configure machines to hibernate/suspend when they are idle since long time.

We have latest atom based processors and LCD screen monitors which were procured since they are very efficient in their use of energy. Thus choice of machines procured for teaching labs has also been made considering energy related aspects into mind.

We use latest Fedora operating systems in teaching labs so that we get cutting edge and latest softwares / applications. But by default Fedora Operating System does not hibernates/suspends machine if it is not used for long time. The default settings are two switch of monitor after half an hour which is too much and to never suspend/hibernate machine.

Members of energy conservation club first log in to machines and configure them so that monitor gets switched of if machine is idle for five minutes. Also if machine continues to remain idle for another five minutes then it automatically suspends. Unfortunately the version of Fedora we are using does not provides hibernate option use normal power manager options hence we configured machines to suspend if they are idle for ten minutes and not to hibernate. To see details steps on how to configure this click here.

When we tested our configuration we observed that monitor gets switched off automatically after five minutes as expected. Also machine goes to suspend state if it is idle for continuous ten minutes. But this works only if the user from which we did this power settings is logged into system.

If we just switch on the system and no user logs in for long time. The machine does not goes to suspend state after ten minutes. We tried making the power setting system wide default but that does not helps either. The same problem arises if users logs off from system and leaves without shutting down. In this case also machine remains on without getting suspended.

To take care of this problem we wrote a program to hibernate machine if no user logs in for continous ten minutes. This way machine hibernates if we just switch it on and leave it as it is without logging in. Also if user logs off and does not shutdowns the machine then also PC gets hibernated after ten minutes and considerable power is saved.

The program can be downloaded from here. Sometimes hibernate does not works properly. Like we faced problem that network connections stopped when we tried to start hibernated machines. In such cases one can use the shutdown program which can be downloaded from here. The shutdown program can shutdown machine if it is not used for ten minutes. This again wont cause data loss to logged in users, as even if one user is logged in, even via ssh then this program will not shutdown the machine.

Use Makefile to compile the program using 'make' command. Then configure machine to run the program automatically at start-up. To configure program to run at start-up as root user follow these steps:

  1. First copy hibernate executable obtained after compilation to some standard location like /sbin or /bin using command "cp hibernate /sbin"
  2. Now edit file "/etc/rc.d/rc.local". This is the start-up file executed when PC boots in Red Hat like distributions which include RHEL, Cent OS, Fedora etc.
  3. Add line "/sbin/hibernate >/dev/null 2>&1 &" to rc.local file

<<Back to ideas page