"systemctl suspend" command does not work very well in a MacBook Pro 2012

Hello Friends

In a LAN exist 2 laptops HP and Toshiba having installed Ubuntu Desktop 24.04.
Through the Terminal for each one is executed the following command:

sleep 60 && systemctl suspend

As expected the screen goes black and the suspend mode starts. To resume is pressed the “PowerOn” button of the laptop itself and if my memory does not fail can be pressed either the Esc or Intro keys. For any case the login screen again appears and is possible be working. Until here no reason to create this post

In a MacBook Pro 2012 was installed directly in its new SSD Ubuntu Desktop 24.04. Now, when the same command is executed the screen goes black as expected but in less of 5 seconds always and automatically appears the login screen.

How to fix this?

Note the sleep 60 command is only used to let a Remmina client time to close the remote connection

1 Like

I think I would be looking at Settings-> Power
Do you have suspend enabled there?

If all seems OK there, havd a look at the file /etc/logind.conf or /etc/elogind.conf
It might be /etc/systemd/logind.conf, if you have systemd.
There are many parameters there that affect affect suspend behaviour.
Compare the file to that in another system that works.

1 Like

Neville

Thanks for the reply and sorry for the huge delay

I think I would be looking at Settings-> Power
Do you have suspend enabled there?

I did do the following (same as HP and Toshiba):

Settings
 Power
  Screen Blank
   To "Never"
 Privacy & Security
  Screen Lock
   Blank Screen Delay
    To "Never"

That’s all

If all seems OK there, havd a look at the file /etc/logind.conf or /etc/elogind.conf
It might be /etc/systemd/logind.conf , if you have systemd.
There are many parameters there that affect affect suspend behaviour.
Compare the file to that in another system that works.

Yes about the /etc/logind.conf file as indicated at:

Therefore (as HP and Toshiba)

  1. Open the /etc/systemd/logind.conf file
  2. Edit from #HandleLidSwitch=suspend to HandleLidSwitch=ignore
  3. Execute the sudo systemctl restart systemd-logind command

Thus for each laptop when the laptop’s lid is closed happens 2 things:

  1. The screen goes black
  2. The laptop is still working in peace

Each laptop is accessed through Remmina.

Therefore for HP and Toshiba:

  • Meanwhile the lid is closed the laptop is still working thanks to HandleLidSwitch=ignore. Important to note: as a secondary consequence the monitor of the laptop is black, it was not configured but is useful
  • Never happens the “suspend” action due of any time of inactivity

So again, through Remmina is possible work with each latop

Finally when I need go to sleep the sleep 60 && systemctl suspend command is executed for each laptop and thus they go to “sleep” until I open the lid. So appears the login and once logged, the lid is again closed and is possible work with these laptops within the LAN

For both posts in this network, in the MacBook Pro does not work as the other laptops

2 Likes