Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

XDG_RUNTIME_DIR not set in the environment

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
Brainslug
Posts: 9
Joined: 2011-03-24 06:20

XDG_RUNTIME_DIR not set in the environment

#1 Post by Brainslug »

Hi,

I would appreciate some help with running programs in X (WindowMaker) as another user.

Until recently (Debian Stretch) I was able to run graphical programs in X as a second user, like so:

- log into X as user1
- run "xhost+"
- run "su - user2"
- run any graphical program (gthumb, konquerer, ...) as user2

Now when I try to run a program as user2, I get

Code: Select all

 user2@localhost:~$ gthumb
 error: XDG_RUNTIME_DIR not set in the environment.
 Segmentation fault 
XDG_RUNTIME_DIR for user1 points to /run/user/1000 which I believe gets created by pam_systemd when logging into X. However, doing "su - user2" does not create /run/user/1001. Why not? And how do I get on-the-fly user switching working again?
Related to this, /run/user/1001 not being created on user switch has always caused me some grief b/c audio would not work for user2. But I could work around that by piping pulse through a socket. But now graphics are also broken and that I can't seem to work around.

Any help would be much appreciated!

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: XDG_RUNTIME_DIR not set in the environment

#2 Post by Head_on_a_Stick »

Can you not just use:

Code: Select all

XDG_RUNTIME_DIR=/run/user/1001 gthumb
EDIT: I think your problem stems from version >1.16 of Xorg being rootless; this requires all sessions to be launched from the same TTY from which the user logged on.
deadbang

Brainslug
Posts: 9
Joined: 2011-03-24 06:20

Re: XDG_RUNTIME_DIR not set in the environment

#3 Post by Brainslug »

Hi,

unfortunately,
XDG_RUNTIME_DIR=/run/user/1001 gthumb
does not work either. I can set the variable and the error message goes away, but gthumb (or any other program) still segfaults, because /run/user/1001 does not exist and I can't get pam_systemd to create it on user switching.
I think your problem stems from version >1.16 of Xorg being rootless; this requires all sessions to be launched from the same TTY from which the user logged on.
This is a good point. With systemd.logind taking over login handling a lot of the things I used to be able to do on my system just broke. However, except for audio, the graphical switching was still working after X 1.16 was introduced and even long into 1.17. Just recently this stopped working. I think this is a major regression in X and makes my live fairly miserable. I can understand that "su - user2" may no longer work with the way login is now handled, but X-forwarding via ssh should still work, "ssh -X user2@localhost" -- it doesn't.

Any ideas, anyone? I thought linux was a multi-user system, but now it's like Win3.1, back to just one user at a time...

Thanks!

Brainslug
Posts: 9
Joined: 2011-03-24 06:20

Re: XDG_RUNTIME_DIR not set in the environment

#4 Post by Brainslug »

strange - after the latest libstdc++6 / gcc upgrade (5.2.1-23) , things are working again. I can "su - user2" and fire up all the GUIs as before.

Not sure what exactly fixed the problem (or broke things in the first place), but I'm glad it's working again.

Thanks!

Post Reply