viernes, 18 de abril de 2014

Arch Linux suspending sleeping each 30 seconds

This was the situation for a non Linux expert after installing for first time the lightweight distribution.
The system was going unconditionally to sleep after 3 minutes after the power on, and afterwards sleeping each 30 seconds.

Google did not show anyone with this situation therefore here is the post for the next one. As not being a Linux expert I was out of clue who is triggering the action.

Hint: as in the base installation there are not so many processes so a top commands shows some useful information. Certainly yes, each time the suspend happened a new process looked get the CPU. Anyway the time between top acknowledging the process and showing it, and the system suspending was in the order of milliseconds my eyes could not see it.

Hint2: Waste cpu in a paralel process so that my eyes, or a camera could see it:
dd if=/dev/zero of=/dev/null

This would work for a single core CPU, the next item would be setting top to update as fast as possible, and the third recording it with your smartphone video camera.


Video

The process to blame was systemd-logind. It is a service inside systemd which can be configured in /etc/systemd/logind.conf check here for details.

Somehow some of the suspend/hibernate buttons of the laptop were detected as pressed. Where the system(Compaq Evo laptop) had no such keys. Therefore I recommend to look at which keys you really want to have functional and ignore the rest:


[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
HandlePowerKey=poweroff
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
PowerKeyIgnoreInhibited=yes
SuspendKeyIgnoreInhibited=yes
HibernateKeyIgnoreInhibited=yes
LidSwitchIgnoreInhibited=yes
#IdleAction=ignore
 #IdleActionSec=30min 

No hay comentarios: