I have a running emacs daemon, and somehow lost the ability to connect to it.
Here are some relevant command output:
$ pgrep -a emacs
12664 emacs --daemon
$ lsof -c emacs -a -u $USER -a -U -w
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
emacs 12664 me 3u unix 0xffff928d28f77000 0t0 113323181 type=STREAM
# find /tmp -iname "*emacs*"
# find /tmp -inum 113323181
I also tried manually searching through
/tmp for the socket file.
lsof result shows a unix socket exists, but it looks like I lost the 'filename' for it. Is that correct? Is there a way to recover it, so that I might re-connect to the running daemon?
I tried the following, to no effect (the socket file was blinking red on my terminal window):
$ ls /proc/12664/fd/3 /proc/12664/fd/3@ $ cp /proc/12664/fd/3 /tmp/user/1007/emacs-daemon_recovered_socket_file cp: cannot open '/proc/12664/fd/3' for reading: No such device or address
Using 'cp -a' did perform a copy, but just of the broken link, so attempting to use it failed:
\emacsclient -nw -s /tmp/user/1007/emacs-daemon_recovered_socket_file emacsclient: can't find socket; have you started the server? To start the server in Emacs, type "M-x server-start". emacsclient: error accessing socket "/tmp/user/1007/emacs-daemon_recovered_socket_file"