[systemd-devel] Help on Automatic Symlink XDG_DATA_HOME

systemdkiosk at yopmail.com systemdkiosk at yopmail.com
Fri Nov 1 19:54:20 PDT 2013


Zbigniew Jędrzejewski-Szmek wrote:

> 'systemctl --user show-environment' will show what's set

I get errors as normal user and root.

$ systemctl --user show-environment 
Failed to issue method call: Process /bin/false exited with status 1
$ su -
Password:
# systemctl --user show-environment 
Failed to get D-Bus connection: Unable to autolaunch a dbus-daemon
without a $DISPLAY for X11



> systemd is executed by systemd
> with a standard set of variables

Might sysd avoid/defer possibly wrong values until they are reliable?
Might it offer a config file for admins to override assumptions? Note my
XDG vars need $USER, so:
export XDG_DATA_HOME="/tmp/user_data_for_$USER"

> /etc/profile* is unfortunately shell-only, so it's not something
> that systemd can use directly. I think that adding a custom pam
> module would be a better option here (c.f. pam_env(8)).

Everything else works swell with /etc/profile* values, and, for that
matter, even systemd does after login. KDE works in its entirety. Read
on XDG_RUNTIME_DIR. tightly bound to login.
http://standards.freedesktop.org/basedir-spec/latest/ar01s03.html

If I need PAM trickery then I'd rather drop a one-line script into
/etc/profile.d to delete the symlink and call it a wrap.

But philosophically, would it be fair to say:

"All vars can, and should, be set or changed in /etc/profile.d, except
XDG vars, which only for the sake of systemd should be set elsewhere."

Is that idea documented or proposed anywhere, or desirable design? Isn't
the issue more about sysd bootstrapping glitches?

Thanks for the feedback in any case. Sounds like a cleanup script is the
fast answer. Maybe in future sysd can offer an admin config file for XDG
vars.

Glad I asked, help was appreciated and very rapid.

Best
Dave

-- 
http://www.fastmail.fm - IMAP accessible web-mail



More information about the systemd-devel mailing list