unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Felix Lechner via "Development of GNU Guix and the GNU System distribution." <guix-devel@gnu.org>
To: Attila Lendvai <attila@lendvai.name>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: shepherd service, unexplained permission errors
Date: Wed, 28 Jun 2023 13:56:29 -0700	[thread overview]
Message-ID: <CAFHYt57GorwRtB4cR5m-kK19VFRhnfuscO9CXTHjE_Dm8ET9ug@mail.gmail.com> (raw)
In-Reply-To: <xAeYA3uQx4VxLH1SUk_4phLjrDjAQaIMpEsidlPhJesVA4v9vTY1RUHnz4G-lJ1G7N7cK2aD69MdPWdjCa_ondu-hxuWvNFA39Q2skQ4fvw=@lendvai.name>

Hi Attila,

On Wed, Jun 28, 2023 at 1:27 PM Attila Lendvai <attila@lendvai.name> wrote:
>
> but through Shepherd the daemon fails while starting up due to a permission denied error:
>
> i created a user for that daemon, and added dialout as a supplementary group:
>
>  (supplementary-groups '("dialout"))
>
>            (fork+exec-command
>             cmd
>             #:log-file "/var/log/zigbee2mqtt.log"
>             #:user "zigbee2mqtt"
>             #:group "homeaut")))))))

The declaration of Shepherd's fork+exec-command has another optional
parameter for "supplementary-groups" [1] which is passed straight to
exec-command. [2]

With a double negation, the language in the manual is a bit hard to
parse, but the explicit argument may be required in order for the
supplementary group to work the way you expect:

"Likewise, command will be run under the current group, unless the
group keyword argument is present and not false, and
supplementary-groups is not '(). " [3]

Kind regards
Felix

[1] https://git.savannah.gnu.org/cgit/shepherd.git/tree/modules/shepherd/service.scm#n1569
[2] https://git.savannah.gnu.org/cgit/shepherd.git/tree/modules/shepherd/service.scm#n1610
[3] https://www.gnu.org/software/shepherd/manual/shepherd.html#index-exec_002dcommand


  reply	other threads:[~2023-06-28 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-28 20:27 shepherd service, unexplained permission errors Attila Lendvai
2023-06-28 20:56 ` Felix Lechner via Development of GNU Guix and the GNU System distribution. [this message]
2023-06-29  7:42   ` Attila Lendvai

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=CAFHYt57GorwRtB4cR5m-kK19VFRhnfuscO9CXTHjE_Dm8ET9ug@mail.gmail.com \
    --to=guix-devel@gnu.org \
    --cc=attila@lendvai.name \
    --cc=felix.lechner@lease-up.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).