Hi Tanguy, I'm not particularly familiar with flask, but the environment variable approach I suggested simply updates the PATH to allow your start command subprocess to be able to call other commands without absolute file paths (e.g., flask, curl, wget). Of course, for this to work, you have to first make sure that these packages are installed in the system profile since that is the only one that I added to the PATH here.
Good luck, Gary "Tanguy Le Carrour" <[email protected]> writes: > Hi Gary, > > > On Wed Jan 21, 2026 at 4:52 PM CET, Gary Johnson wrote: >> It looks like you are on the right track, but you may just need to fix the >> PATH environment variable and add (default-environment-variables) back in to >> start function like so: >> >> ``` >> #:environment-variables (append (list (string-append "PYTHONPATH=" >> #$(file-append gertrude (string-append "/lib/python" (version-major+minor >> (package-version python)) "/site-packages/"))) >> (string-append "DSN=" >> #$data-source-name) >> >> "PATH=/run/setuid-programs:/run/current-system/profile/bin:/run/current-system/profile/sbin") >> (default-environment-variables)) >> ``` >> >> Note that the default PATH environment variable is pretty unusable within >> Shepherd services, so you'll need to set it explicitly as above if your >> services need to find another package in the environment. > > Oh… that would be great! 🤩 > … but… ran that way, it complains that it cannot find `flask` that is a > propagated dependency > of `gertrude`. 😞 > > ```scheme > (start #~(make-forkexec-constructor > (list > (string-append #$gunicorn "/bin/gunicorn") > (string-append "--access-logfile=-") > (string-append (format #f "--workers=~a" #$workers)) > (string-append (format #f "--bind=~a:~a" #$address #$port)) > "gertrude.configuration:wsgi()") > #:user #$user > #:group #$group > #:log-file #$log-file > #:environment-variables (append > (list > (string-append "PYTHONPATH=" #$(file-append gertrude > (string-append "/lib/python" (version-major+minor (package-version python)) > "/site-packages/"))) > (string-append "DSN=" #$data-source-name) > > "PATH=/run/setuid-programs:/run/current-system/profile/bin:/run/current-system/profile/sbin") > (default-environment-variables)))) > ``` > > I don’t know what the value of `default-environment-variables` is. I might be > overwritting > the value of `PYTHONPATH`? 🤔 -- GPG Key ID: C4FBEDBD Use `gpg --search-keys [email protected]' to find me Protect yourself from surveillance: https://emailselfdefense.fsf.org ======================================================================= () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments Why is HTML email a security nightmare? See https://useplaintext.email/ Please avoid sending me MS-Office attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
