[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shepherd services have unwanted environment variables
From: |
Ludovic Courtès |
Subject: |
Re: shepherd services have unwanted environment variables |
Date: |
Mon, 16 Sep 2019 18:04:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Hi!
address@hidden (宋文武) skribis:
> Hello, when fixing an issue for our libvirtd service, I found that most
> our shepherd services inherit the default environment variables of the
> pid 1 'shepherd', which is:
>
> $ cat /proc/1/environ | tr '\0' '\n'
> HOME=/
> TERM=linux
> BOOT_IMAGE=/gnu/store/xwp07fcvwj9dpjsr9z4x9l03z9jj7fgx-linux-5.2.8/bzImage
> --root=system
> --system=/gnu/store/58gir4yk5xj2lqzvlja8ml57z54k54n0-system
> --load=/gnu/store/58gir4yk5xj2lqzvlja8ml57z54k54n0-system/boot
> PATH=/gnu/store/q8bcf3cl33mq31y9k1wnwc895ng3qdq8-e2fsck-static-1.45.2/sbin
> GUIX_LOCPATH=/gnu/store/94k5w17z54w25lgp90czdqfv9m4hwzhq-glibc-utf8-locales-2.28/lib/locale
>
> Obviously, we don't want BOOT_IMAGE, --root, --system, --load here, and
> this PATH is not good.
Indeed.
> I think a resonable default could be:
>
> LANG=<from operating-system>
> GUIX_LOCPATH=/run/current-system/locale
> LINUX_MODULE_DIRECTORY=/run/booted-system/kernel/lib/modules
>
> PATH=/run/setuid-programs:/run/current-system/profile/bin:/run/current-system/profile/sbin
What about turning ‘default-environment-variables’ in (shepherd service)
into a SRFI-39 parameter?
That way, in Guix, we could set that default to something like you write
above.
Thoughts?
Thanks,
Ludo’.