Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 794649

Summary: app-emacs/emacs-daemon fails to set the socket location emacsclient 27 expects by default
Product: Gentoo Linux Reporter: Judge Dredd <the.guard>
Component: Current packagesAssignee: GNU Emacs project <gnu-emacs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: sam, the.guard
Priority: Normal Keywords: UPSTREAM
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://debbugs.gnu.org/33847
https://dev.gnupg.org/T6160
https://debbugs.gnu.org/51327
Whiteboard:
Package list:
Runtime testing required: ---

Description Judge Dredd 2021-06-07 02:15:35 UTC
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.
Comment 1 Ulrich Müller gentoo-dev 2021-06-07 22:28:57 UTC
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").
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-08-25 07:51:24 UTC
Apparently fixed upstream as of 28.1 (I can't read debbugs properly...)
Comment 3 Ulrich Müller gentoo-dev 2022-08-25 08:53:12 UTC
(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.