How to enable “sleep after x minutes of inactivity” on out-of-box Ubuntu Server16.04?

Discussion in 'Other Operating Systems' started by mrjayviper, Jul 3, 2016.

  1. mrjayviper

    mrjayviper Member

    Joined:
    Jul 18, 2012
    Messages:
    453
    So how do I know it's not working? Well on my MacPro, I set it to go to sleep after 15 minutes of inactivity. The monitor turns off and then the fans and all lights turns off. This doesn't happen on my newly setup Ubuntu Server 16.04 box.

    so I was searching the net and it seem Ubuntu has built-in power management features. I found a folder called "/etc/pm/sleep.d".

    [​IMG]

    Looking at the filename and actual contents, it doesn't seemed it has any thing to do with "sleep after x minutes of inactivity".

    I've seen many discussions/Ubuntu wiki pages but they seemed to use third-party tools. But I somehow doubt Ubuntu on default install have no power management. This seems like a basic requirement for a modern OS.

    Unless of course Ubuntu on default install DOES NOT provide "sleep after x minutes of inactivity" feature? And in that case, which 3rd-party is recommended? I'm seen pm-utils mentioned a lot. But I've also seen mentions of powernap.

    This is a list of my basic requirements:

    1. Host sleeps after x minutes of inactivity (CPU idle, no network traffic and etc)
    2. wakes up due to various reasons (mouse/keyboard input, network traffic like I initiated an SSH connection on my Macbook, cron and etc)
    3. slow down or speed up CPU (speedstep?) as needed

    My setup:

    AMD FM2 board with Realtek NIC. Video card is built-in into the CPU

    Thanks a lot
     
    Last edited: Jul 3, 2016
  2. gibbz

    gibbz Member

    Joined:
    Jan 20, 2004
    Messages:
    1,473
    Location:
    Adelaide, SA
    Why would you want your server to sleep?
    Ubuntu desktop has sleep function built in. But I don't see why anyone would use this on the server version...
     
  3. OP
    OP
    mrjayviper

    mrjayviper Member

    Joined:
    Jul 18, 2012
    Messages:
    453
    Sleep is for power saving when there's NO activity. Why wouldn't you want the host to not sleep when there's no activity?

    It's for my personal home server. But even then, were have lots of servers at work that does nothing outside of office hours. If I was in charge, I would like them to save power but sleeping/suspending.

    Also I don't understand/see why people do lots of things but as long as they don't affect me, I don't really care.
     
    Last edited: Jul 3, 2016
  4. ^catalyst

    ^catalyst Member

    Joined:
    Jun 27, 2001
    Messages:
    11,916
    Location:
    melbourne
    Yeaaah nah. auto idle off etc is complete anathema for a server. Turning them off overnight/rebooting in the morning probably wouldn't do as much as you'd think for you power bill.

    The best thing I can find is this :

    http://oils-of-life.com/blog/linux/server/auto-shutdown-and-auto-suspending-a-linux-server/

    It's comprehensive and has some nice options via the .conf for the suspend action. Run it as a cron job and you'll be laughing.

    Alternatively you could run the desktop build and you'd get all that stuff 'for free' as it fits better. I'm not sure what would happen if you ran the Alternate Installer and installed the desktop edition without the desktop environment; most of the standard auto-sleep / auto-shutdown etc are based somehow on X; which your server won't be running.
     
    Last edited: Jul 4, 2016
  5. kripz

    kripz Member

    Joined:
    Sep 29, 2004
    Messages:
    2,834
    Location:
    Near Frankston
  6. OP
    OP
    mrjayviper

    mrjayviper Member

    Joined:
    Jul 18, 2012
    Messages:
    453
    I've actually thought of using even lubuntu just for the power management settings.
     

Share This Page

Advertisement: