[Bug 1222172] New: emacsclient -n -c fails to start when emacs daemon is started early

https://bugzilla.suse.com/show_bug.cgi?id=1222172 Bug ID: 1222172 Summary: emacsclient -n -c fails to start when emacs daemon is started early Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: screening-team-bugs@suse.de Reporter: gabriel.bertazi@suse.com QA Contact: qa-bugs@suse.de Target Milestone: --- Found By: --- Blocker: --- TW includes emacs.service to start an emacs server through systemd. I enable the unit file: systemctl enable --user emacs after log out/log in, the server is started properly within the user session. But any attempt to start a client with a frame (-c) disconnected from the shell (-n) fails silently: emacsclient -n -c // fails immediately and returns 1. journald shows: 29 15:54:29 cartola emacs[29953]: xauth: (argv):1: bad display name "wayland-0" in "extract" command 29 15:54:29 cartola emacs[29953]: No matches found, authority file "-" not written 29 15:54:29 cartola emacs[29953]: xauth: (argv):1: unable to read any entries from file "(stdin)" Curiously, if I omit the -n parameter, it kind of works. A tiny window gets created. It seems the frame is misconfigured as it ignored the window setting: emacsclient -c Now... If, from a shell, I restart the service: systemctl restart --user emacs Then, both: emacsclient -n -c emacsclient -c work fine, and respect the window sizes previously set. I suspect the problem is some missing wayland environment variable that is not configured when emacsd is first started. After restart, when everything works, I see the /proc/<pid>/environ is much longer. In particular these are now set in the emacs daemon environment: XAUTHORITY=/run/user/1000/emacs/xauth XAUTHLOCALHOSTNAME=mylaptop I'm using the distro provided unit file: [0:krisman@cartola ~]$ systemctl status --user emacs ● emacs.service - Emacs text editor Loaded: loaded (/usr/lib/systemd/user/emacs.service; enabled; preset: disa> Active: active (running) since Fri 2024-03-29 15:56:04 EDT; 8min ago Docs: info:emacs man:emacs(1) -- You are receiving this mail because: You are on the CC list for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1222172 Chenzi Cao <chcao@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|screening-team-bugs@suse.de |werner@suse.com -- You are receiving this mail because: You are on the CC list for the bug.

https://bugzilla.suse.com/show_bug.cgi?id=1222172 https://bugzilla.suse.com/show_bug.cgi?id=1222172#c4 Gabriel Krisman Bertazi <gabriel.bertazi@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(gabriel.bertazi@s | |use.com) | --- Comment #4 from Gabriel Krisman Bertazi <gabriel.bertazi@suse.com> --- (In reply to Dr. Werner Fink from comment #2) Should emacs (In reply to Dr. Werner Fink from comment #1)
Usr REAL X not broken wayland ... does this work?
Not really. considering wayland is becoming a default everywhere and I need stuff like per-display scaling, X is becoming a worse option everyday, no matter how crappy wayland is... Also, isn't gnome over wayland the default installation on TW? (In reply to Dr. Werner Fink from comment #2)
Btw: HOW should a already running emacs daemon know about size of a not stared display?
Perhaps the emacs daemon service unit should depend on the graphical environment: [unit] After=gnome-session-manager@gnome.service It's been a PITA debugging this because logout-login seems to be preserving some environment somehow, and I simply cannot reproduce without a full reboot. But I'll test this. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com