unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* shepherd services have unwanted environment variables
@ 2019-09-11 23:51 宋文武
  2019-09-16 16:04 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: 宋文武 @ 2019-09-11 23:51 UTC (permalink / raw)
  To: guix-devel

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: shepherd services have unwanted environment variables
  2019-09-11 23:51 shepherd services have unwanted environment variables 宋文武
@ 2019-09-16 16:04 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2019-09-16 16:04 UTC (permalink / raw)
  To: 宋文武; +Cc: guix-devel

Hi!

iyzsong@member.fsf.org (宋文武) 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’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-09-16 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 23:51 shepherd services have unwanted environment variables 宋文武
2019-09-16 16:04 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).