[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: getting loginctl to work
From: |
SeerLite |
Subject: |
Re: getting loginctl to work |
Date: |
Mon, 27 Mar 2023 07:21:09 -0300 |
Hi! Is it maybe Polkit? Polkit was stopping me from suspending my laptop via
SSH. The exact same behavior as you: no output and error code 1.
Since the only `loginctl` command I cared about was `suspend`, I added my user
to the `power` group, added the `power` group to `operating-system`, defined
the following extension:
; Rule template stolen from from gnu/services/desktop.scm: polkit-wheel
; and rule itself stolen from https://askubuntu.com/a/992878
(define polkit-power-rules
(file-union
"polkit-power"
`(("share/polkit-1/rules.d/power.rules"
,(plain-file
"power.rules"
"polkit.addRule(function(action, subject) {
if (action.id == \"org.freedesktop.login1.suspend\" &&
subject.isInGroup(\"power\")) {
return polkit.Result.YES;
}
});")))))
and added the above to my services like:
(simple-service 'polkit-power-rules polkit-service-type (list
polkit-power-rules))
You'd have to do something but I'm guessing for `login1.poweroff` instead.
SeerLite