Debian falls asleep on me

If none of the more specific forums is the right place to ask
Post Reply
Message
Author
User avatar
millusions
Posts: 58
Joined: 2014-10-05 14:02

Debian falls asleep on me

#1 Post by millusions »

Hey Guys!

Got Debian 9.8 'stretch' setup. i chose KDE.

it's pretty good. on day 2 after some general setup i dove right into ffmpeg to encode some stuff as that's what the box is built for.
left it overnight, hammering all cores but after 188MB the thing goes to sleep.

wtf?

i tested sleep, and it works well, pretty happy with that, but shouldnt it go to sleep when idle?

is there a way to fix it? without some app that keeps it awake, because i do want it to sleep when it finishes encoding.

thanks in advance!

reinob
Posts: 935
Joined: 2014-06-30 11:42

Re: Debian falls asleep on me

#2 Post by reinob »

Did you change anything in /etc/systemd/logind.conf?

Make sure IdleAction=ignore. AFAIK systemd is (or was) broken in this respect, where it would send the computer to sleep (if IdleAction=suspend) regardless of what you were doing. Guess you can always find a suitable definition of "Activity".. :)

If the above is OK, you should check your KDE settings. On that I have zero experience (I compiled and used KDE 1.x for some time.. a long time ago! :)

User avatar
Hallvor
Posts: 1189
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 4 times
Been thanked: 2 times

Re: Debian falls asleep on me

#3 Post by Hallvor »

Check your power management settings.
Lenovo ThinkPad T440S, Intel Core i7-4600U CPU @ 2.10GHz, 8 GB RAM, 256 GB SSD, Debian Bullseye (KDE)
Lenovo ThinkPad X240, Intel Core i5-4300U CPU @ 2.90GHz, 8 GB RAM, 120 GB SSD, Debian Bullseye (KDE)

User avatar
Head_on_a_Stick
Posts: 13450
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Debian falls asleep on me

#4 Post by Head_on_a_Stick »

reinob wrote:AFAIK systemd is (or was) broken in this respect, where it would send the computer to sleep (if IdleAction=suspend) regardless of what you were doing.
To clarify: only the GNOME desktop interacts correctly with systemd and triggers the IdleAction as expected.

See https://github.com/systemd/systemd/issues/1295

@OP: please post the output of

Code: Select all

systemd-inhibit
If you haven't edited /etc/systemd/logind.conf then this dirty hack might fix things for you:

Code: Select all

# systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
EDIT: and put some clothes on, for goodness sake :mrgreen:
Black Lives Matter

Debian buster-backports ISO image: for new hardware support

User avatar
millusions
Posts: 58
Joined: 2014-10-05 14:02

Re: Debian falls asleep on me

#5 Post by millusions »

hi guys.


Hallvor, i will contact the admins because you deserve a grand prize for your post. it was so helpful i fell of my chair - im in debt for ever!

Head_on_a_stick: i havent touched those files at all.
system-inhibit shows:
Who: ModemManager (UID 0/root, PID 507/ModemManager)
What: sleep
Why: ModemManager needs to reset devices
Mode: delay

Who: PowerDevil (UID 1000/marty, PID 1160/org_kde_powerde)
What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
Why: KDE handles power events
Mode: block

Who: NetworkManager (UID 0/root, PID 502/NetworkManager)
What: sleep
Why: NetworkManager needs to turn off networks
Mode: delay

/etc/systemd/logind.conf looks like this:
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
#HandleLidSwitch=suspend
#HandleLidSwitchDocked=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
#HoldoffTimeoutSec=30s
#IdleAction=ignore
#IdleActionSec=30min
#RuntimeDirectorySize=10%
#RemoveIPC=yes
#InhibitorsMax=8192
#SessionsMax=8192
#UserTasksMax=33%

you know. i miss the 3.0 Woody days, but i guess i had a ton of time back then. fond memories.
but i think i'm going to distro jump. the two days of bliss are up. now my TPlink T9E (broadcom-sta-dkms) is not seeing 5GHz networks. it worked fine for a couple of days.
i really don't want to sweat over something like a wifi card, maybe if it was some dodgy 20$ job.
im not sure Gnome is the answer, although i might give it a try, because the command runs in a terminal, i think the direction Gnome took over the years is pretty rubbish. it was ok years ago but now it's a mess imho.

maybe sid is the answer, i dont know

there's a command in Macs.. example: caffeinate -i ffmpeg -i blah blah | which will keep the mac awake until command is finished. there's nothing like that in Linux?

reinob
Posts: 935
Joined: 2014-06-30 11:42

Re: Debian falls asleep on me

#6 Post by reinob »

millusions wrote:there's a command in Macs.. example: caffeinate -i ffmpeg -i blah blah | which will keep the mac awake until command is finished. there's nothing like that in Linux?
Yup, you can:

$ systemd-inhibit ffmpeg ..

or

$ systemd-inhibit /bin/bash

and systemd should not activate any power saving until the command ends..

User avatar
millusions
Posts: 58
Joined: 2014-10-05 14:02

Re: Debian falls asleep on me

#7 Post by millusions »

thank you reinob!

you're a legend! exactly what i needed

Post Reply