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

Manuel Jordan

Commendable
Apr 3, 2022
253
5
1,685
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
 
Hello Friends

In a LAN exist 2 laptops HP and Toshiba having installed Ubuntu Desktop 24.04. Because they are accessed only by me through Remmina was applied the following configuration to avoid use unnecessarily the screen of each laptop:

  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
Remember each laptop is accessed through Remmina.

Observation: if the laptop's lid is opened - at least with an angle more of 05 degree angle - the screen shown what is being executed. In other words is not the screen is not black any longer. Furthermore if the laptop's lid is opened with less of 5 degree angle the screen remains in black.

In a MacBook Pro 2012 was installed directly in its new SSD Ubuntu Desktop 24.04. Now, applying by complete all the same procedures indicated above: when the laptop's lid is closed the screen remains working - it is not turned black - I've confirmed this by opening the laptop's lid with a small degree angle.

How to fix this?

Just in case when the laptop's lid is closed by complete the "apple" light is turned on in white
 
Hello Friends

Ubuntu Desktop 24.04 was installed on a new SSD in a MacBook Pro 2012. It works fine. The following situation has happened only twice:

The laptop is turned off and of course it's lid is closed. At any time suddenly it will startup by itself - even with the lid closed. The first time it happened was when I returned after shopping but I did not realize because the external cooler was still working. After 1 or 2 weeks it happened just one hour ago, meanwhile I was working on another laptop.

As you can see it happened between a considerable range of time.

Observation: just in case, the following configuration was done:

In the /etc/systemd/logind.conf file was edit from #HandleLidSwitch=suspend to HandleLidSwitch=ignore and was executed the sudo systemctl restart systemd-logind command

I am sure the second event happened after of that configuration but I don't remember if the first event happened before or after the configuration.

How to fix this situation?
 
In the /etc/systemd/logind.conf file was edit from #HandleLidSwitch=suspend to HandleLidSwitch=ignore and was executed the sudo systemctl restart systemd-logind command
All that will do is ignore the lid switch, which in certain models its a momentary switch which this patch is done so it doesn't wake the screen if it went into standby with it open and you close it afterwards.

The power dialog in settings control the files in sys/devices/platform/(machine) which in this case it would be something like sys/devices/platform/apple-laptop

In each file you set the bit value (-1 disabled, 0 off (software controlled) , 1 enabled)
for the files:
lid_resume_S3
lid_resume_S4
lid_resume_S5


S3 is suspend, S4 is hibernate, S5 is power-off. But what is associates with the problem is lid_resume_S3 and lid_resume_S4 which is not constant across laptops. So I would edit the files and change the bit value and observe.
 
  • Like
Reactions: Manuel Jordan
All that will do is ignore the lid switch, which in certain models its a momentary switch which this patch is done so it doesn't wake the screen if it went into standby with it open and you close it afterwards.

The power dialog in settings control the files in sys/devices/platform/(machine) which in this case it would be something like sys/devices/platform/apple-laptop

In each file you set the bit value (-1 disabled, 0 off (software controlled) , 1 enabled)
for the files:
lid_resume_S3
lid_resume_S4
lid_resume_S5


S3 is suspend, S4 is hibernate, S5 is power-off. But what is associates with the problem is lid_resume_S3 and lid_resume_S4 which is not constant across laptops. So I would edit the files and change the bit value and observe.
Thanks for the reply

Soon as I can I am going to confirm if exists the " sys/devices/platform/(machine)" path and if yes what is contained there
 
Hello

At the "/sys/devices/platform" directory exists the following content:

ACPI0003:00 applesmc.768 eisa.0 kgdboc PNP0C0C:00 power rtc-efi.0
acpi-cpufreq coretemp.0 'Fixed MDIO bus.0' microcode PNP0C0D:00 reg-dummy serial8250
APP0002:00 efivars.0 intel_rapl_msr.0 pcspkr PNP0C0E:00 regulatory.0 uevent

About the "apple" term, in the "applesmc.768" directory exists the following content:

calibrate hwmon modalias temp12_label temp17_label temp21_label temp6_label
driver input name temp13_input temp18_input temp2_input temp7_input
driver_override key_at_index position temp13_label temp18_label temp2_label temp7_label
fan1_input key_at_index_data power temp14_input temp19_input temp3_input temp8_input
fan1_label key_at_index_data_length subsystem temp14_label temp19_label temp3_label temp8_label
fan1_manual key_at_index_name temp10_input temp15_input temp1_input temp4_input temp9_input
fan1_max key_at_index_type temp10_label temp15_label temp1_label temp4_label temp9_label
fan1_min key_count temp11_input temp16_input temp20_input temp5_input uevent
fan1_output leds temp11_label temp16_label temp20_label temp5_label
fan1_safe light temp12_input temp17_input temp21_input temp6_input

Sorry for the presentation, but nothing about the "lid_resume_SN" files

Some thoughts?

Thank You
 
applesmc.768 is the machine directory and the files are located here should be sensor and switch settings or status. the applesmc.768/power/ directory is the settings.

Further info about the power directory is here:
kernel.org /sys/devices/.../power

depending on who wrote the driver, is where the final destination of these end points, but generally they are going to be filed here or in a sub directory.