You are not logged in.

#1 2012-09-08 11:19:17

cgo
Member
From: Paris, France
Registered: 2010-11-05
Posts: 22

[solved] systemd / logind poweroff instead of halt

Hi,

I have a full systemd host (laptop, thinkpad x201), without acpid running and the following in /etc/systemd/logind.conf :
HandlePowerKey=always

When hitting the power key, the system goes to halt. What I'd like to do is to poweroff instead.

- If I call "systemctl start poweroff.target", it powers my computer off.
- In the source code of logind (in logind-button.c), I saw it's supposed to call poweroff.target:

core/special.h: #define SPECIAL_POWEROFF_TARGET "poweroff.target"
logind-button.c: r = bus_manager_shutdown_or_sleep_now_or_later(b->manager, SPECIAL_POWEROFF_TARGET, INHIBIT_SHUTDOWN, &error);

So, what can I  do to poweroff when hitting the power button ?

Note: I know about this and it's not helpful: https://bbs.archlinux.org/viewtopic.php?id=148212

Thanks,
Charles

Last edited by cgo (2012-09-18 20:09:16)

Offline

#2 2012-09-11 12:43:55

cgo
Member
From: Paris, France
Registered: 2010-11-05
Posts: 22

Re: [solved] systemd / logind poweroff instead of halt

Hi,

If I set the log level to debug and output it to the console (in systemd.conf), then hitting the power button powers my computer off. Without it, the system is halted but the computer stays on.

Real strange... Maybe it's more a hardware-related problem.

Offline

#3 2012-09-18 20:09:01

cgo
Member
From: Paris, France
Registered: 2010-11-05
Posts: 22

Re: [solved] systemd / logind poweroff instead of halt

Ok, I found the problem... It was just a configuration I had in i3 config (bindsym XF86PowerOff exec sudo /sbin/halt). i3 catches the key before logind most of the time.
I found it by enabling journal persistent storage.

Silly me.

Last edited by cgo (2012-09-18 20:11:49)

Offline

Board footer

Powered by FluxBB