In any major Operating System (OS) distribution, there would be an option to suspend the machine in order to preserve the electricity consumption. It gets significantly important if the machine is running on a limited-capacity battery.

Ubuntu, may suspend or put your laptop to sleep usually under 2 conditions. Either after exceeding a specific idle time or after the laptop lid was closed.

The downside of this sleep or suspend feature is, it might freeze the process that is intentionally being executed by the user.

How to disable Ubuntu from suspending the machine

  1. Boot up your Ubuntu laptop, and login.
  2. Open up system “Setting” windows and click “Power” on left side menu.
  3. On right side, under “Power Saving Options”, turn off “Automatic Suspend”.
  4. Update logind.conf file by uncommenting theses 4 lines with your prefered text editor.
    $ sudo vim /etc/systemd/logind.conf
    HandleLidSwitch=ignore
    HandleLidSwitchExternalPower=ignore
    HandleLidSwitchDocked=ignore
    LidSwitchIgnoreInhibited=no
Discuss the article:

Comment anonymously. Login not required.