[systemd-devel] Set environment variable system-wide

Lennart Poettering lennart at poettering.net
Wed Aug 8 09:56:16 PDT 2012


On Mon, 06.08.12 15:17, Daniel Drake (dsd at laptop.org) wrote:

> 
> On Mon, Aug 6, 2012 at 3:09 PM, Kay Sievers <kay at vrfy.org> wrote:
> > systemctl set-environment ... ?
> 
> Maybe thats what I read about.
> 
> In this case I'm looking to set it in early boot though, so that it
> affects all spawned processes from the very start. Is there a nice way
> of doing this?

This has been requested before, and we do support this for locale
settings (which are ultimately env vars), but I am very conservative
about adding a generic way to set system-wide env vars at boot from a
config file.

> > But it's in almost all use cases wrong to use anything like that isn't
> > broken unix legacy that expects it that way.
> 
> I'm having trouble parsing that sentence. In this case I'm looking for
> a clean way to set PYTHONOPTIMIZE system wide (to enable Python's
> optimized bytecode usage).

I don't think anything can be considered "clean" if it involves setting
system-wide env vars. There must be another way to teach Python
optimization system-wide...

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list