guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

proper way to satisfy service dependencies


From: Vladilen Kozin
Subject: proper way to satisfy service dependencies
Date: Thu, 23 Mar 2023 14:00:45 +0000

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]