[systemd-devel] user environment variables

Lennart Poettering lennart at poettering.net
Fri Dec 5 05:32:46 PST 2014


On Fri, 05.12.14 14:13, arnaud gaboury (arnaud.gaboury at gmail.com) wrote:

> Dear all,
> 
> For the user services started by systemctl --user, I sometimes need to
> tell systemd some environment variables values.
> 
> For this purpose, I use drop-in configuration files (MyService.conf)
> in /etc/systemd/system/user at .service.d
> 
> I am wondering if there is another way to pass the variables values.
> I was thinking to some user directory like this :
> ~/.config/systemd/user at .service.d (does not work) or import one only
> file with all these variables values with this command at session
> start up: systemctl --import-environment FILE (does not work), or
> maybe something like systemctl --import-environment 'cat FILE'.

systemctl set-environment `cat FILE` should work, no?

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list