all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: SeerLite <seerlite@disroot.org>
To: Martin Castillo <castilma@uni-bremen.de>, help-guix@gnu.org
Subject: Re: getting loginctl to work
Date: Mon, 27 Mar 2023 07:21:09 -0300	[thread overview]
Message-ID: <A6C249D0-8C78-49A0-A3A3-390AD57B26B8@disroot.org> (raw)
In-Reply-To: <bcac7d5a-ffb1-1baa-8b66-2041616a8d7b@uni-bremen.de>

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


  parent reply	other threads:[~2023-03-27 10:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22 21:20 getting loginctl to work Martin Castillo
2023-03-23 19:09 ` Csepp
2023-03-24 16:04   ` Martin Castillo
2023-03-27 10:21 ` SeerLite [this message]
2023-03-27 13:18   ` Martin Castillo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A6C249D0-8C78-49A0-A3A3-390AD57B26B8@disroot.org \
    --to=seerlite@disroot.org \
    --cc=castilma@uni-bremen.de \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.