How to properly suspend via command

16,887

Solution 1

AFAIK the correct command is systemctl suspend or hibernate as this command uses Systemd and is preferred since 16.04

Link to prior similar question. In the comments/answers section they say the old dbus method (which is your first example command) supposedly was deprecated

Solution 2

In systems before 15.04 you use dbus approach only. On Ubuntu 15.04 and newer you use both, because Ubuntu started systemd init system. Both are proper, they just use different programs to achieve same result.

Difference is that systemd is init system, it controls starting other processes at boot. dbus isterprocess communication system and is most useful in desktop to allow users do some tasks without need for root access

Share:
16,887

Related videos on Youtube

cytopia
Author by

cytopia

__ https://github.com/cytopia https://everythingcli.org https://mysqldump-secure.org __

Updated on September 18, 2022

Comments

  • cytopia
    cytopia over 1 year

    I found two working versions to properly suspend my notebook to RAM.

    $ dbus-send --system --print-reply \
       --dest=org.freedesktop.login1 /org/freedesktop/login1 \
       "org.freedesktop.login1.Manager.Suspend" boolean:true
    

    and

    $ systemctl suspend
    

    Which of the above is the one to use and what is the difference between those?

  • cytopia
    cytopia over 7 years
    Thanks for your answer. Although you were the fastest answering it correctly, the other answer provided a useful link for me.