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


View this message in rfc822 format

From: help-debbugs <at> gnu.org (Emacs bug Tracking System)
To: pent <pent <at> aparamon.msk.ru>
Subject: bug#1467 closed by Андрей Парамонов
 <cmr.pent <at> gmail.com> (Re: Bug#539809: emacs23-gtk: emacsclient cannot
 connect to daemon run  from tty1)
Date: Wed, 05 Aug 2009 00:55:06 +0000
[Message part 1 (text/plain, inline)]
This is an automatic notification regarding your bug report
which was filed against the emacs package:

#1467: 23.0.60; Cannot "emacsclient -c" to daemon started from tt1

It has been closed by Андрей Парамонов <cmr.pent <at> gmail.com>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Андрей Парамонов <cmr.pent <at> gmail.com> by
replying to this email.


-- 
1467: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1467
Emacs Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
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
[Message part 3 (message/rfc822, inline)]
From: pent <pent <at> aparamon.msk.ru>
To: emacs-pretest-bug <at> gnu.org
Cc: rfrancoise <at> debian.org
Subject: 23.0.60; Cannot "emacsclient -c" to daemon started from tt1
Date: Mon, 01 Dec 2008 23:03:29 +0300
0) Start X session.

1) Switch to tty1 or any other console terminal and run
  
   $ emacs --daemon

   Emacs server loads (correct).

2) Make sure you can connect to it by running

   $ emacsclient -t

   This should work from both tty and X sessions (correct).

3) Switch to X session and run

   $ emacsclient -c

   This fails with message

   Waiting for Emacs...
   *ERROR*: Display :0.0 can't be opened

I think it would be really nice if Emacs could easily survive X crash.

I'm ready to provide any additional info,
Andrey

In GNU Emacs 23.0.60.1 (i486-pc-linux-gnu, GTK+ Version 2.12.11)
 of 2008-11-30 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20081129-1)
Windowing system distributor `The X.Org Foundation', version 11.0.10402000
configured using `configure  '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/23.0.60/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.0.60/site-lisp:/usr/share/emacs/site-lisp' '--with-x=yes' '--with-x-toolkit=gtk' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g -Wl,--as-needed' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ru_RU.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Info

Minor modes in effect:
  delete-selection-mode: t
  pc-selection-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t



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.