Re: The best recommendation for allowing "su" in X
>> Osamu Aoki <email@example.com> writes:
> Here is .xinitrc for this.
> # This makes X work when I su to root.
> if [ -z "$XAUTHORITY" ]; then
> export XAUTHORITY
> # invoke global X session script
> . /etc/X11/Xsession
> > I don't understand. I *have* a .xsession and it works just fine.
> Of course, you set up this file right. I had a working .xsession too :)
Stripping the parts of my .xsession that figure out if I'm working on a
broken box or not (i.e., is this Debian or not? ;-) I'm left with:
if command -v xscreensaver > /dev/null 2>&1 ; then
xscreensaver -no-splash -timeout 6 -lock-mode &
xmessage -center 'Warning: no screen saver running'
Really. That's my xsession on Debian boxes, nothing else. And I
haven't changed the system's Xsession files. And I get and exported
XAUTHORITY by default.
> any X session started by either startx or xdm
perhaps we have identified the problem.
If you remove your customizations and use startx, do you get an
exported XAUTHORITY variable or not? If yes, that's what I'm seeing.
Now the question is if using xdm changes this somehow. It might be.
AFAIR xdm contacts the X server and asks it for a cookie; perhaps it's
xdm that's failing to export this information (it should).
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact email@example.com