ow to disable all power management in Ubuntu (for a server netbook)?

How to disable all power management in Ubuntu (for a server netbook)?

i.gif?e=eyJhdiI6NzExMzEsImF0Ijo0LCJidCI6

up vote        7        down vote        favorite        

4

I need to disable everything related to having the netbook-server go into sleep/hibernate/shutdown.  Spinning down the disks during inactivity is fine, but it is crucial that the machine remain in a state where it maintains connectivity over wi-fi (and the internet at large), as well as keep the USB subsystem up and operational (we're running a hardware modem off of it).

Context:

  • The netbook is not phyiscally accessible (it is in Thailand, I am not).

  • I have SSH access only

  • It is running vanilla Ubuntu 10.04 32 Bit

  • It is a netbook of the Asus eeePC variety

Is that possible to do via the command line without causing significant/any downtime?

linux ubuntu electrical-power    

shareimprove this question

edited Jul 6 '12 at 13:52    

   

MDMarra
       83.2k16131268    

asked Oct 14 '11 at 15:00    

   

adewinter
       41114    


6                        

A "server netbook"? Holy silicon! Why haven't you installed the server version of Ubuntu?                �C                     the-wabbit                Oct 14 '11 at 15:44                                                                            

5                        

This has disaster written all over it. I have a feeling this is probably not the best solution to the underlying problem.                �C                     kce                Oct 15 '11 at 21:57                                                                            

add a comment                    

3 Answers

active        oldest        votes

   

                       

up vote        6        down vote        accepted

You can disable those power management features at various level.

Graphical User Interface level

In GNOME, you should edit the following file:

sudoedit  /usr/share/polkit-1/actions/org.freedesktop.upower.policy

One section concerns the suspend function and the other the hibernate one. Each as a tag  that you have to set to no:

<allow_active>no</allow_active>

Keyboard level

Now, to avoid the problem if the keyboard has some related keys for these features, you have to enter the following command:

gconftool -s /apps/gnome-power-manager/buttons/hibernate -t string interactive

Command line level

It would still be possible to trigger a suspend or hibernation from the command line, here is how to disable it.

We have to create an executable script in /etc/pm/sleep.d/ that will cancel any hibernate or suspend actions.

sudoedit /etc/pm/sleep.d/000cancel-hibernate-suspend

The content of this file should be:

#!/bin/sh
# prevents hibernation and suspend
. "$PM_FUNCTIONS"
case "${1}" in
  suspend|hibernate)
    inhibit
    ;;
  resume|thaw)
    exit 0
    ;;
esac

Now make that file executable:

chmod 0755 /etc/pm/sleep.d/000cancel-hibernate-suspend

   

shareimprove this answer


你可能感兴趣的:(fun)