Unplugging laptop after locking my session kills all my processes

Hello everyone, happy new year!

Basically my problem is that whenever I run xflock4, to lock my screen, and then I unplug my laptop, when I log-in again, all my processes are killed: no program is open.

What happens normally when locking the screen? I guess normally the system gets suspended. But maybe after unplugging, it tries to hibernate, and since I don’t have a swap partition it just kills everything. But maybe it’s something else.

What could be going on wrong? I also don’t see any option on XFCE’s Power Manager menus related to this.

Thanks a lot in advance

No, locking the screen is simply locking the screen, requiring you to enter a password in order to regain access to your desktop session. It doesn’t have anything to do with suspending the system or hibernating.

Presumably there’s some issue with unplugging your laptop. It’s possible that your battery has an intermittent disconnection from the system, or that it has worn too much to still provide for enough current to keep the system running when unplugging.

What happens if you unplug while still logged in?

Thanks for the answer! But I don’t think so, my battery still lasts very long: I can use my laptop un-plugged. I also can log-out and log-in again without problems, when it’s already un-plugged.

The problem is the act of un-plugging it when I’ve logged out.

Nothing, it works as expected. Also: loggin-in and out while it’s already un-plugged also works as expected.

There is ambiguity here. Are you referring to logging out or to locking the screen? Those are two different things.

If you lock the screen, then you’re still logged in, and then your user processes will still be running in the background. If on the other hand you log out, then your user-started processes will be terminated.

This is perfectly normal, because all of your user-started processes are children of your user login.

Whatever running xflock4 does, which I assume is locking the screen. Then I assume something is indeed wrong?
Thanks for the answer and sorry for my late reply (I’ll set the email notifications for this forum now :sweat_smile:)