5

I got the not terribly helpful error message recently trying to connect emacsclient to a emacs daemon using tcp sockets.

emacsclient: error accessing server file "server"

Looking at the source, its not obvious what is going wrong - http://git.savannah.gnu.org/cgit/emacs.git/tree/lib-src/emacsclient.c?h=emacs-24#n1356

Any suggestions?

(I tried to recompile emacs and attach a gdb, but I didn't have much luck with that)

Job Evers
  • 300
  • 1
  • 8

1 Answers1

3

For a socket the permissions should be srwx------ - the s, meaning "socket" is the important part. (I also tried removing the executable bit, it didn't make a difference).

Since the permissions are -rw------- you are not using a socket. There are two ways to fix that, (1) make sure you are using a socket (2) tell emacsclient that it's not a socket.

(1) Make sure the value of server-use-tcp is nil (which happens to be the default). It has to be nil at the time you start the daemon, changing it later only serves to confuse you.

(2) Tell emacsclient to connect to a tcp file using emacsclient --server-file=SERVER.

I recommend the former.

tarsius
  • 25,298
  • 4
  • 69
  • 109