Results 1 to 3 of 3

Thread: is powernap still around?

  1. #1
    Join Date
    Jul 2015

    is powernap still around?

    I am back w/ essentially the same situation I've encountered before:
    I have a couple of desktops that i would like to automatically suspend when nobody is logged in. Also a couple of headless servers that i'd like to suspend on a schedule. I have used powernap for a long time, as recently as w/ 18.04. However I recently upgraded to 20.04 and powernap appears to be obsoleted and removed from the standard repositories. I'd appreciate any suggestions about accomplishing what i need to do.

    It dawned on me that i think I can adequately control the servers using cron and rtcwake. With the desktops, I guess I need a simple way to detect if any users are logged in, so that is a corollary question.
    Last edited by dlbrewe; December 30th, 2022 at 06:14 PM.

  2. #2
    Join Date
    Mar 2010
    Ubuntu Development Release

    Re: is powernap still around?

    I see 'powernap' list in focal (20.04) but diving deeper, I don't see it further than 18.04(???)

    On checking for logged in users...
    #!/bin bash
    logged_in=$(w | grep -v 'average\|LOGIN@' | awk '{print $1}') ## Check for logged in users, return UserName
    if [ -z $logged_in ]
      echo "No one is logged in"
      #systemctl suspend   ##hibernate 
      rtcwake -m disk -s 900   ## Hibernate to disk and wake up in 15 minutes...
      echo "Users are logged in"
    The problem would be to power back on via command line... Using rtcwake, you could wake up in 15 minutes, then check for activity again (cron running this scipt)
    Last edited by MAFoElffen; December 31st, 2022 at 04:05 PM.

    "Concurrent coexistence of Windows, Linux and UNIX..." || Ubuntu user # 33563, Linux user # 533637
    Sticky: Graphics Resolution | UbuntuForums 'system-info' Script | Posting Guidelines | Code Tags

  3. #3
    Join Date
    Mar 2014

    Re: is powernap still around?

    Thanks for the ideas! I'm not sure I follow the details but I came up with a simple solution that seems to work well enough for me.


    if [ "$logins" = "" ]; then
    systemctl suspend

    I run this script at intervals from /etc/crontab. So far it seems to work well enough.

    Thanks again. (BTW somehow I have two ubuntu forums accounts and logged in to the other one to post this question.

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts