FS#19649 - [gdm] GDM fails to create ~/.Xautority

Attached to Project: Arch Linux
Opened by Vladimir (Psycho_zs) - Sunday, 30 May 2010, 12:50 GMT
Last edited by Jan de Groot (JGC) - Monday, 21 February 2011, 07:45 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
GDM fails to create ~/.Xautority
Tested on relatively clean system and with new user.

Also tried slim and gdm-old: both correctly create ~/.Xautority

Additional info:
gdm 2.30.2-2

Steps to reproduce:
Start gdm daemon, login.
stat ~/.Xauthority - it was not created/updated at login time.
switch to virtual console, launch:
DISPLAY=:0 some_gui_app - it will not be able to connect to running X server.
This task depends upon

Closed by  Jan de Groot (JGC)
Monday, 21 February 2011, 07:45 GMT
Reason for closing:  Not a bug
Comment by Jan de Groot (JGC) - Monday, 31 May 2010, 09:14 GMT
Works fine here. Note that GDM doesn't create ~/.Xauthority anymore, but creates the file in /var/run/gdm and puts the filename in the XAUTHORITY environment variable.
Comment by Vladimir (Psycho_zs) - Monday, 31 May 2010, 09:50 GMT
Gnome devs making curious non-standard things as usual...
Then how do I tweak it to be able to use cron and launch gui apps from console on specific disaplay?
I've added user to group gdm, it didn't work...
Comment by Jan de Groot (JGC) - Monday, 31 May 2010, 10:02 GMT
This is not non-standard, that's why the XAUTHORITY environment variable was invented. GDM can't always write in the user homedirectory, I know older versions of GDM used to write files in /tmp if the homedir wasn't writable by the GDM user.
Comment by Vladimir (Psycho_zs) - Monday, 31 May 2010, 10:30 GMT
I've checked my ubuntu installation: GDM has same behaviour there, but despite that everything works.
Making echo $XAUTHORITY from console returns empty string on both ubuntu and arch, but in ubuntu I can launch gui apps from console when using gdm. In arch I can't.
How can I fix that?
Comment by Vladimir (Psycho_zs) - Tuesday, 08 June 2010, 16:19 GMT
> Works fine here.
Do you mean you were able to launch something from console to display?
Comment by Vladimir (Psycho_zs) - Sunday, 18 July 2010, 14:55 GMT
workaround:
Add user to gdm group.
Add this command to gnome session in gnome-session-properties:
sh -c "sleep 5s && ln -sf `echo $XAUTHORITY` ~/.Xauthority"
Comment by Stanislav GE (giner) - Thursday, 30 December 2010, 12:02 GMT
Work around is here. Tested in Ubuntu 10.10.

cat << EOF | sudo tee /etc/gdm/PostLogin/Default
#!/bin/bash

auth=\$HOME/.Xauthority
if [ -e \$auth ]; then
diff <(xauth extract - \$DISPLAY) \\
<(XAUTHORITY=\$auth xauth extract - \$DISPLAY) > /dev/null \\
&& exit 0
fi
xauth extract - \$DISPLAY | XAUTHORITY=\$auth xauth merge -
EOF
sudo chmod +x /etc/gdm/PostLogin/Default
Comment by Stanislav GE (giner) - Thursday, 30 December 2010, 12:05 GMT

Loading...