emacs-daemon fails to set the socket location emacsclient 27 expects by default Reproducible: Always Steps to Reproduce: 1. switch to emacs 27 2. start emacs-daemon (tested for non-root user) 3. try to run emacsclient Actual Results: error connecting to socket Expected Results: normal start The problem seems to be in the startup process. Now, as of version 27, emacs expects XDG_RUNTIME_DIR to be set to use that location for the socket file (https://github.com/emacs-mirror/emacs/blob/emacs-27/etc/NEWS#L328) but it's not set correctly when using start-stop-daemon --user for a regular user.
See upstream bug: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33847 As a workaround, define the EMACS_SOCKET_NAME environment variable (it should typically have a value "/tmp/emacs${UID}/server").
Apparently fixed upstream as of 28.1 (I can't read debbugs properly...)
(In reply to Sam James from comment #2) > Apparently fixed upstream as of 28.1 (I can't read debbugs properly...) Not fixed, but I agreed in https://debbugs.gnu.org/51327 (messages #69 and #78 there) that the Emacs 27 behaviour is still better than what was suggested in that bug.