guix-devel
[Top][All Lists]
Advanced

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

shepherd services have unwanted environment variables


From: 宋文武
Subject: shepherd services have unwanted environment variables
Date: Thu, 12 Sep 2019 07:51:40 +0800

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:

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

Obviously, we don't want BOOT_IMAGE, --root, --system, --load here, and
this PATH is not good.

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

So we can have shepherd services running under the same locale
configured by user and finding runtime binaries (eg: for libvirtd to
find qemu) in standard places.

What do you think?



reply via email to

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