From: Maxime Devos <maximedevos@telenet.be>
To: edk@beaver-labs.com, help-guix@gnu.org
Subject: Re: Environment of a shepherd service
Date: Sun, 25 Apr 2021 17:36:58 +0200 [thread overview]
Message-ID: <75a95dd5315d1633452694f824b42141989d9c03.camel@telenet.be> (raw)
In-Reply-To: <87r1jgsjme.fsf@rdklein.fr>
[-- Attachment #1: Type: text/plain, Size: 2859 bytes --]
edk@beaver-labs.com schreef op zo 11-04-2021 om 21:31 [+0200]:
> Dear fellow Guixers,
> [...]
> But, when I try to run it with shepherd, it fails because it can't find
> flask (a dependency of the software, which I've put as a
> propagated-input, and is indeed installed in the container).
Propagated inputs can be inconvenient at times. I would advise
looking where requisomatic is referring to flask, and replacing
flask --> (string-append (assoc-ref inputs "flask") "/bin/flask")
using substitute*.
> But, when I try to run it with shepherd, it fails because it can't find
> flask (a dependency of the software, which I've put as a
> propagated-input, and is indeed installed in the container).
> [...]
Some advice (warning: I'm not familiar with gunicorn or requisomatic at all).
>
> -----extract from my operating-system declaration file-------
> (define requisomatic-shepherd-service
> ([...] (shepherd-service
> [...]
(documentation "Run the requisomatic server")
> (start #~((make-forkexec-constructor
> ;; (append
> ;; (if db-file
> ;; `("env"
> ;; ,(string-append "REQUISOMATIC_DB_FILE=" db-file))
> ;; '())
> '("gunicorn" "requisomatic:app")
Normally, services refer by absolute path to the binary to run, and not rely
on the PATH (the latter would require polluting the system profile).
Idiomatically, one would write
'(#$(file-append gunicorn "/bin/gunicorn")
#$(file-append requisomatic) "/wherever/the/binary/is")
> #:directory (string-append #$requisomatic "/bin/requisomatic/")
Why are you changing the working directory to
(string-append #$requisomatic "/bin/requisomatic/"), and why is "/bin/requisomatic" a
directory and not an executable? Is that a gunicorn thing?
> Why is the PYTHONPATH (and the other env vars, for that matter) not
> propagated from the package to the shepherd service by default ?
How is the shepherd service supposed to automagically know which packages
to include in the environment variables?
> And how can I make it so ?
Use the #:environment-variables option, see e.g. bitlbee-shepherd-service
Or create a wrapper. See e.g. wrapped-dbus-service.
> Follow up question, can shepherd services be specified to run in a
> specific profile ?
IIUC, currently shepherd services aren't run in *any* profile at all.
It would be useful to have a function manifest->environment-gexp though.
> So that I can have two services with incompatible
> dependencies running at the same time in the same operating-system ?
Yes, it with "dependencies" you mean packages, and not other services.
Greetings,
Maxime.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]
next prev parent reply other threads:[~2021-04-25 15:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-11 19:31 Environment of a shepherd service edk
2021-04-13 20:12 ` Edouard Klein
2021-04-13 20:47 ` Jonathan McHugh
2021-04-14 7:59 ` Edouard Klein
2021-04-25 15:36 ` Maxime Devos [this message]
2021-04-27 20:03 ` Edouard Klein
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=75a95dd5315d1633452694f824b42141989d9c03.camel@telenet.be \
--to=maximedevos@telenet.be \
--cc=edk@beaver-labs.com \
--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.