GNU bug report logs - #1467
23.0.60; Cannot "emacsclient -c" to daemon started from tt1

Previous Next

Package: emacs;

Reported by: pent <pent <at> aparamon.msk.ru>

Date: Mon, 1 Dec 2008 20:10:04 UTC

Severity: normal

Done: Андрей Парамонов <cmr.pent <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #25 received at 1467-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Андрей Парамонов <cmr.pent <at> gmail.com>
To: "Trent W. Buck" <trentbuck <at> gmail.com>
Cc: 539809 <at> bugs.debian.org
Subject: Re: Bug#539809: emacs23-gtk: emacsclient cannot connect to daemon run 
	from tty1
Date: Tue, 4 Aug 2009 23:42:30 +0400
2009/8/4 Trent W. Buck <trentbuck <at> gmail.com>:
> Is the XAUTHORITY environment variable defined within your X session?
>
> If so, the reason the Emacs daemon can't connect to your X server is
> because it is trying to use ~/.Xauthority, but the file is in some
> other place.
>
> GDM puts the .Xauthority file in a different place when $HOME is on a
> root-squashed NFS filesystem, because when the file is created GDM
> runs as root, and can't write the file to ~/.Xauthority as normal.  It
> sets the XAUTHORITY environment variable to the other place (in
> /tmp/), so all the child processes know to look there.
>
> But emacs --daemon was started outside of the GDM process tree, so it
> doesn't "see" the XAUTHORITY environment variable.
>
> When I ran into this problem (using screen, not emacs --daemon), I
> worked around it with the following code in my .xsession file:
>
>    ## Dance so screen subprocesses can talk to GDM-spawned X servers.
>    if test -n "$XAUTHORITY"
>    then
>        xauth extract - $DISPLAY |
>        xauth -f ~/.Xauthority merge -
>        unset XAUTHORITY
>    fi
>
> Note that depending on your DM, .xsession may be called .xinitrc or
> .Xclients.  Typically you also have to choose "default X session" or
> similar, rather than "GNOME" or whatever.
>

Thank you for a very helpful response!

I don't use NFS, but the problem was indeed in my ~/.Xauthority (it
was owned by root and 600 for some reason). I've removed my
~/.Xauthority and restarted X, and now my Emacs can survive X crash
:-)

Andrey



This bug report was last modified 15 years and 345 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.