[systemd-devel] systemd user unit - how to prepare environment?

Lennart Poettering lennart at poettering.net
Tue Sep 11 12:40:24 UTC 2018


On Di, 11.09.18 09:26, Kamil Jońca (kjonca at o2.pl) wrote:

> I post on debian-user, but no answer.
> Maybe here I found some knowledge.
> 
> KJ
> kjonca at poczta.onet.pl (Kamil Jońca) writes:
> 
> > I tried to setup some user units in my desktop, and have problem with
> > env variables.
> > So far I set them up in custom .xsession file (in home directory)
> > I tried to put
> > something like
> > systemctl --user import-environment NNTPSERVER
> > in my .xsession file, but it looks like this script is run parallel with
> > user units, and I have race condition, ie. some units can't see
> > variables.
> >
> > So my question is, where to init variables for user units?
> > I woluld like to have possiblity to set them as not only as fixed
> > strings
> >
> > (i.e. I would to have PATH=$PATH:xxx)

You can add them to ~/.config/systemd/user.conf in the Environment=
field in the [Manager] section, see systemd-system.conf(5).x

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list