[systemd-devel] XDM and systemd --user

Kok, Auke-jan H auke-jan.h.kok at intel.com
Fri Sep 28 12:09:27 PDT 2012


On Fri, Sep 28, 2012 at 11:58 AM, Mantas Mikulėnas <grawity at gmail.com> wrote:
> On Fri, Sep 28, 2012 at 9:47 PM, Kok, Auke-jan H
> <auke-jan.h.kok at intel.com> wrote:
>> On Fri, Sep 28, 2012 at 4:23 AM, Peeters Simon <peeters.simon at gmail.com> wrote:
>>> 2012/9/28 Peter Lemenkov <lemenkov at gmail.com>:
>>>> Hello All!
>>> Hello
>>>
>>>> First question - is this a correct way to run systemd --user? I saw a
>>>> "user at .service script" but it does requires root permission to run.
>>> this is afaik a correct way as long as a single user does not have
>>> multiple sessions.
>>>
>>>> Second question - I've lost all /etc/profile stuff which was set up
>>>> somehow in the depths of Xorg-related script's swamp. I'd like to run
>>>> it (as well as some other shell scripts) and borrow its envvars (at
>>>> least for some applications) - is it possible?
>>>
>>> systemd currently does not parse /etc/profile (and never will?)
>>
>> it shouldn't - you can't just "parse" it - you have to basically eval
>> it in a full shell, and this is frankly out of fashion.
>
> Unfortunately, all other options (EnvironmentFile and pam_env) are
> just too limited – none of them support even plain nesting of
> variables (as in PATH=$HOME/bin:$PATH or
> XDG_CONFIG_HOME=$HOME/.config).
>
> I try to keep my ~/.environ clean of shell logic
> (http://git.io/S0M_Sg), but I still cannot see myself giving up
> `MAKEFLAGS=-j$(nproc)` or `source ~/.environ-$HOSTNAME`...
>
> Not to mention that many packages install /etc/profile.d/ scriptlets
> to set envvars the program depends on (JAVA_HOME, MOZ_PLUGIN_PATH, and
> even LANG – which has to be set from profile because getty at .service
> unsets it.)

Two comments:

1) people should fix 'make' to just allow `-j` without an argument
(seriously, dude ;^) )

2) You can already do many of these things, and I've sent various
patches to address the problem. The following should already work:

user at .service:
...
[Service]
Environment=XDG_CONFIG_HOME=%h/.config
Environment=SSH_AUTH_SOCKET=%t/ssh_auth_socket

and even %H should now properly expand to $HOSTNAME, I just saw a
patch fly in this week.

I'm thinking that the settings you want to set should be read/executed
when you open a terminal, but there's no need to set MAKEFLAGS for
gnome-session... This is outdated and we should work on fixing this,
instead of giving up and going back to the VW transporter and sniffing
glue ;^)

So, come help trying to resolve these issues with me!

Auke


More information about the systemd-devel mailing list