unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* connecting to a lost server process
@ 2019-07-12  6:20 Madhu
  2019-07-12  7:54 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Madhu @ 2019-07-12  6:20 UTC (permalink / raw)
  To: help-gnu-emacs

I'm having problems with the behaviour of emacs --daemon.  Under some
circumstances when the emacsclient -t dies (say when the GNU screen
dungeon collapses), The server file and server directory gets
unexpectedly deleted.  In this case the server is left running but one
cannot connect to it.

The socket is still open as can be seen in /proc/<emacspid>/fd/ - is
there some linux arcana that can be exploited to connect to it?

Earlier it used to be possible to gdb attach to the emacs process and
to restart the server. Something like
Feval(Fcar(Fread_from_string(build_string("(server-start)"),Qnil,Qnil)),Qnil)
But for some time now that route hits a
terminate_due_to_signal. (Apparently make-network-process tries to
signal an error which calls emacs_abort which ends the show)

[Unfortunately recently the robustness of the server mechanism has gone
down - (especially since elogind).  Typically I set
XDG_RUNTIME_DIR=/dev/shm/<username> in my environment and start a
server which i expect to survive restarts in dbus, elogind etc.  That
seems no longer possible even when using a --without-x emacs.]






^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: connecting to a lost server process
  2019-07-12  6:20 connecting to a lost server process Madhu
@ 2019-07-12  7:54 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2019-07-12  7:54 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: 12 Jul 2019 06:20:57 -0000
> From: Madhu <enometh@meer.net>
> 
> The socket is still open as can be seen in /proc/<emacspid>/fd/ - is
> there some linux arcana that can be exploited to connect to it?
> 
> Earlier it used to be possible to gdb attach to the emacs process and
> to restart the server. Something like
> Feval(Fcar(Fread_from_string(build_string("(server-start)"),Qnil,Qnil)),Qnil)
> But for some time now that route hits a
> terminate_due_to_signal. (Apparently make-network-process tries to
> signal an error which calls emacs_abort which ends the show)

Please report a bug with the details of that crash, it may or may not
be a bug.

> [Unfortunately recently the robustness of the server mechanism has gone
> down - (especially since elogind).  Typically I set
> XDG_RUNTIME_DIR=/dev/shm/<username> in my environment and start a
> server which i expect to survive restarts in dbus, elogind etc.  That
> seems no longer possible even when using a --without-x emacs.]

Did you try to bind a function to sigusr1 or sigusr2 event, and have
that function restore the server file?



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-12  7:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-12  6:20 connecting to a lost server process Madhu
2019-07-12  7:54 ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).