unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vladilen Kozin <vladilen.kozin@gmail.com>
To: guix-devel@gnu.org
Subject: proper way to satisfy service dependencies
Date: Thu, 23 Mar 2023 14:00:45 +0000	[thread overview]
Message-ID: <CACw=CXNV7DNxp9qrLJEOQYYXbUifF55nrp2xng-rOaapA79D6A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]

Hi.

When I have a package whose only purpose in life is to be started as daemon
by e.g. Shepherd how would I satisfy its binary dependencies when defining
a service? For packages this is normally part of their (inputs ...) slot,
but IIUC this only makes it so these dependencies will be added to the same
profile used when installing said package. But when I define a service
there's no profile to speak of, so as part of the service definition I need
to make sure I satisfy its dependencies. Say, when I start a network
service that needs to run `iptables`.

The one time I ran into this, I managed by pulling `iptables` module into
derivation context and adding its /sbin to PATH in:
(make-forkexec-constructor ...
  #:environment-variables
  (let ((iptables (string-append #$iptables "/sbin")))
     ... extend PATH= here ...))

Another approach could be wrapping the daemon binary itself as part of its
package definition, so something like (wrap-program ... ) that makes sure
`iptables` is in PATH of that wrapper.

I kinda wish there was a simpler way to just declare what you need as part
of service definition.

What's the preferred approach here?

Thanks
-- 
Best regards
Vlad Kozin

[-- Attachment #2: Type: text/html, Size: 2563 bytes --]

                 reply	other threads:[~2023-03-23 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CACw=CXNV7DNxp9qrLJEOQYYXbUifF55nrp2xng-rOaapA79D6A@mail.gmail.com' \
    --to=vladilen.kozin@gmail.com \
    --cc=guix-devel@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 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).