With GNU Emacs 23.2.1, that I installed from sources on 2 different GNU/Linux distributions (CentOS 4.x, and Ubuntu Hardy - both with KDE 3.x)
I do:
$ emacs --daemon
("emacs")
Starting Emacs daemon.
$ emacsclient -c
Waiting for Emacs...
Emacs starts as expected. Then I close the client. fuser /tmp/emacs${UID}/server
indicates that the socket is alive, and the emacs --daemon
process is running.
$ emacsclient -c
Waiting for Emacs...
Emacs does not start. fuser /tmp/emacs${UID}/server
indicates that the socket is stale, and the emacs --daemon
process no longer exists. And so:
$ emacsclient -c
emacsclient: connect: Connection refused
emacsclient: No socket or alternate editor. Please use:
--socket-name
--server-file (or environment variable EMACS_SERVER_FILE)
--alternate-editor (or environment variable ALTERNATE_EDITOR)
When I keep at least one client running, I can open and close as many other clients I wish.
So my questions are:
- Can anybody else see this behavior?
- Is there a way to keep the socket alive even after the last client exits?
- Is there a good way to check if the socket will allow opening another client?
- Why does the socket stays around if it can no longer be used?
Edit: It seems that emacs --daemon
segfaults. I posted it as bug 7149