Results 1 to 5 of 5

Thread: Need to disable sleep

  1. #1
    Join Date
    May 2007
    Beans
    81

    Need to disable sleep

    I have Ubuntu 18.04.6 LTS running on a Dell Optiplex machine.

    A few years ago I configured it to sleep every 2 hours. Now I need it to never sleep however can‘t for the life of me remember how to do this.

    Could some please help me and provide details on how I can configure it to never sleep.

  2. #2
    Join Date
    Jul 2006
    Location
    Uppsala, Sweden
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Need to disable sleep

    - Jaxilian -

    ||embrace the inevitable||

  3. #3
    Join Date
    May 2007
    Beans
    81

    Re: Need to disable sleep

    Thanks @jaxilian unable to run Tweak Tool since I am running without graphical interface. I‘ve tried the following:
    https://www.tecmint.com/disable-susp...tion-in-linux/
    Waiting to see if this helps.

  4. #4
    Join Date
    May 2007
    Beans
    81

    Re: Need to disable sleep

    Ok that didn‘t work

  5. #5
    #&thj^% is offline I Ubuntu, Therefore, I Am
    Join Date
    Aug 2016
    Beans
    Hidden!

    Re: Need to disable sleep

    Quote Originally Posted by takeawaydave View Post
    Ok that didn‘t work
    Show the result of:
    Code:
    systemctl status sleep.target
    Like:
    Code:
    systemctl status sleep.target
    ○ sleep.target - Sleep
         Loaded: loaded (/usr/lib/systemd/system/sleep.target; static)
         Active: inactive (dead)
           Docs: man:systemd.special(7)
    All right then to disable:
    Code:
     sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
    Result:
    Code:
    Created symlink /etc/systemd/system/sleep.target → /dev/null.
    Created symlink /etc/systemd/system/suspend.target → /dev/null.
    Created symlink /etc/systemd/system/hibernate.target → /dev/null.
    Created symlink /etc/systemd/system/hybrid-sleep.target → /dev/null.
    Now:
    Code:
    systemctl status sleep.target
    ○ sleep.target
         Loaded: masked (Reason: Unit sleep.target is masked.)
         Active: inactive (dead)
    If the occasion arises to re-enable it:
    Code:
    sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
    Result:
    Code:
    Removed /etc/systemd/system/sleep.target.
    Removed /etc/systemd/system/suspend.target.
    Removed /etc/systemd/system/hibernate.target.
    Removed /etc/systemd/system/hybrid-sleep.target.
    Last edited by #&thj^%; February 15th, 2022 at 08:41 PM. Reason: add to

Tags for this Thread

Bookmarks

Posting Permissions

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