Ubuntu – Ubuntu 20.04 | Any way to get rid of “systemctl suspend” and start using “s2ram” globally

20.04dellsuspend

After days trying to fix suspend issues in my laptop. I would like to get rid of the Ubuntu suspend system and completely replace it with "S2RAM".

So basically when I press the Power button, the Sleep button, Close the lid: I just want my laptop to call "S2RAM" application, nothing more.

S2RAM is the only thing that works well in my laptop. If I type sudo S2RAM when I'm playing a video, my laptop goes off in less than 1 second, the Power led and keyboard go off instantly, then I wait some minutes, I press the power button and everything resumes perfectly.

So far I tried this without success:

sudo systemctl edit systemd-suspend.service

And add the following:

[Service]
Type=oneshot
ExecStart=/usr/sbin/s2ram

I also tried the following alternative (changing the path sometimes):

[Service]
ExecStart=
ExecStartPre=-/usr/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/sbin/s2ram
ExecStartPost=-/usr/bin/run-parts -v --reverse -a post /usr/sbin/s2ramlib/systemd/system-sleep

Followed by

systemctl daemon-reload

None of these options seem to work. Because if I type systemctl suspend:

  1. It is not instant like when running sudo S2RAM
  2. Sometimes hangs the system (just like always do)
  3. Sometimes turns off the screens and doesn't come back

So to me, S2RAM is not taking over at all the Ubuntu "suspend" approach.

Is there any other way to achieve this? I think it will be the only solution to make my Dell laptop sleep in Ubuntu. I tried more than 30 solutions, none worked except S2RAM application. I just need to know how to make it default

Best Answer

From your Desktop screen, press F1, then Ctrl + L and type man:systemd-suspend.service.8.
Repeat for man:systemd-sleep.conf.5.

You have more experience in this matter than me as evident in question, but I'm sure this might help.

Related Question