[Bug 1028893] New: Emacs writes extraneous output to stderr when starting
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 Bug ID: 1028893 Summary: Emacs writes extraneous output to stderr when starting Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: x86-64 OS: Other Status: NEW Severity: Minor Priority: P5 - None Component: Other Assignee: bnc-team-screening@forge.provo.novell.com Reporter: mjambor@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- When launching emacs from an xterm or an urxvt terminal in my fluxbox window manager, I always get annoying output to stderr: mjambor@mymachine:~$ emacs Activating service name='org.gnome.GConf' Successfully activated service 'org.gnome.GConf' it is not happening when I run emacs-gtk or emacs-x11 directly, so it must be coming from the alternative picking script /usr/bin/emacs. Running bash -x /usr/bin/emacs to find out which line does it, it is apparently the following one: exec -a /usr/bin/dbus-run-session /usr/bin/dbus-run-session -- /usr/bin/emacs-x11 So I tend to think this is a dbus bug. Technically it is a minor issue but it sure is very annoying, so please make it go away. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c13 --- Comment #13 from Martin Jambor <mjambor@suse.com> --- Simon, have you had a chance to try the proposad fix? Do you agree that my proposals are sensible, at least in general? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c14 --- Comment #14 from Simon Lees <simonf.lees@suse.com> --- (In reply to Martin Jambor from comment #13)
Simon, have you had a chance to try the proposad fix? Do you agree that my proposals are sensible, at least in general?
Sorry not yet, i've been sick and trying to get the patterns stuff done, i'll run it past upstream tomorrow and see what there intentions etc where tomorrow. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c15 --- Comment #15 from Simon Lees <simonf.lees@suse.com> --- (In reply to Martin Jambor from comment #0)
exec -a /usr/bin/dbus-run-session /usr/bin/dbus-run-session -- /usr/bin/emacs-x11
Hang on, this is running the x11 version, most x11 applications that I launch from a terminal output some form of info so personally I don't think this is a big issue, if it was running before or interrupting the command line then I guess it would be. I will still check with upstream though. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c16 --- Comment #16 from Simon Lees <simonf.lees@suse.com> --- Having spoken with upstream there is a couple of things to mention. 1. emacs shouldn't need to call dbus-run-session anyway the session should be started at login all the major distro's on openSUSE do this already anyway. 2. In the next version there will be a new feature --syslog-only which will cause output to only go to the system output. I'll see how feasible it is to backport this feature next week my gut feeling is it should be fine but if its more complex then expected i'll probably wait for the next release. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c17 --- Comment #17 from Dr. Werner Fink <werner@suse.com> --- (In reply to Simon Lees from comment #16)
Having spoken with upstream there is a couple of things to mention.
1. emacs shouldn't need to call dbus-run-session anyway the session should be started at login all the major distro's on openSUSE do this already anyway.
I'm aware ... nevertheless then emacs-gtk does write out a warning that there is no dbus and this will not be written with syslog. This was one reason for me to add this wrapper code to the /usr/bin/emacs shell script. The other side effect is to allow emacs to communicate over dbus, a feature which is useful even over ssh or console login. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c18 --- Comment #18 from Martin Jambor <mjambor@suse.com> --- (In reply to Simon Lees from comment #15)
Hang on, this is running the x11 version, most x11 applications that I launch from a terminal output some form of info
Please do not let the fact that other programs misbehave make you think that misbehaving is fine. Also note that this affects emacs, my preferred text editor which I invoke many dozen times a day from a terminal, and I expect the terminal to be usable and clean and/or contain the original contents while emacs is running.
so personally I don't think this is a big issue,
It is minor but horribly annoying, I try to be constructive here but I swear like the proverbial trooper each time it happens.
if it was running before or interrupting the command line then I guess it would be.
Each time some script or other command (like git, or mutt or many others) invokes $EDITOR, its legitimate output gets garbled with dbus debug messages, so something like that happens too. (In reply to Simon Lees from comment #16)
Having spoken with upstream there is a couple of things to mention.
1. emacs shouldn't need to call dbus-run-session anyway the session should be started at login all the major distro's on openSUSE do this already anyway.
My fluxbox window manager apparently does not do it (and apart from these annoying messages, I admit I do not really mind). But even if it did, this would not cover situations like invoking emacs over ssh -X.
2. In the next version there will be a new feature --syslog-only which will cause output to only go to the system output. I'll see how feasible it is to backport this feature next week my gut feeling is it should be fine but if its more complex then expected i'll probably wait for the next release.
Thanks for that, if I can be of any help, please let me know. (However, I still think that my second patch in comment #10, maybe without the isatty bit, would fix this issue in our current version and hurt nobody). -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c19 --- Comment #19 from Simon Lees <simonf.lees@suse.com> --- I'm currently investigating whether emacs calling this manually is actually covering up deeper issues caused by a stale file. In a ideal world emacs should never need to call this as it should be done automatically at login. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c20 --- Comment #20 from Simon Lees <simonf.lees@suse.com> --- On 04/10/2017 09:07 PM, Simon McVittie wrote:
So the issue here seems to be that the emacs launcher is second-guessing how dbus-launch works: https://build.opensuse.org/package/view_file/openSUSE:Factory/emacs/emacs.sh... and preferring to use dbus-run-session if both dbus-launch and dbus-run-session are available.
This is not the right thing to do. If dbus-launch is installed, libdbus will *already* do the right thing, without emacs needing to reimplement it.
Please raise this with the openSUSE maintainers of emacs. This appears to be a distro-specific issue in code introduced for a particular distribution.
If openSUSE's emacs packaging really needs to do these tricks, it could avoid this failure mode by looking for $XDG_RUNTIME_DIR/bus, and if it is present and owned by the right uid, using it. (dbus-launch --autolaunch already does that.)
The emacs wrapper says
# Now check for valid dbus, e.g. after su/sudo/slogin
which suggests that this is an elaborate workaround for one or both of these situations:
* lacking a session bus and wanting to work around it by borrowing the session bus from the "wrong" login session; under the strict login session model (artificially separate login-sessions) this is just wrong, while under the user-session model it is unnecessary
* escalating privileges without clearing the environment (su, not su -), which can be fixed by clearing the environment correctly
-- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c21 Simon Lees <simonf.lees@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mjambor@suse.com Flags| |needinfo?(mjambor@suse.com) --- Comment #21 from Simon Lees <simonf.lees@suse.com> --- Martin, can you run systemctl status user-1000.slice and check that dbus is being launched as a user service (I don't know how you installed fluxbox but it works with openbox). You should see something similar to this (dbus.service), if you do it means that the emacs script is not detecting that the bus is running and launching its own when it shouldn't. You might also notice some nicely logged "Successfully activated service messages there as well :-) ● user-1000.slice - User Slice of simon Loaded: loaded (/run/systemd/transient/user-1000.slice; transient; vendor preset: disabled) Transient: yes Active: active since Tue 2017-04-11 10:07:21 ACST; 24min ago Tasks: 85 (limit: 10813) CGroup: /user.slice/user-1000.slice ├─session-2.scope │ └─2625 /usr/bin/pulseaudio --start --log-target=syslog ├─session-4.scope │ ├─15052 lightdm --session-child 13 20 │ ├─15077 /usr/bin/gnome-keyring-daemon --daemonize --login │ ├─15079 /usr/bin/openbox --startup /usr/lib/openbox-autostart OPENBOX ...... │ └─16796 systemctl status user-1000.slice └─user@1000.service ├─at-spi-dbus-bus.service │ ├─6358 /usr/lib/at-spi2/at-spi-bus-launcher │ └─6363 /bin/dbus-daemon --config-file=/usr/share/defaults/at-spi2/accessibility.conf --nofork --print-address 3 ├─dbus.service │ ├─2117 /bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation │ ├─6481 /usr/lib/goa-daemon │ └─6491 /usr/lib/goa-identity-service ...... └─init.scope ├─2095 /usr/lib/systemd/systemd --user └─2096 (sd-pam) -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c22 Martin Jambor <mjambor@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(mjambor@suse.com) | --- Comment #22 from Martin Jambor <mjambor@suse.com> --- Well, I get much shorter output: mjambor@virgil:~$ systemctl status user-1000.slice ● user-1000.slice Loaded: loaded Active: inactive (dead) I have installed fluxbox from the package fluxbox from repository http://download.opensuse.org/repositories/X11:/windowmanagers/openSUSE_Tumbl... I log in with normal xdm. Based on comment #20, I changed my .xinitrx to run fluxbox with: exec dbus-run-session -- /usr/bin/startfluxbox but it did not help and did not change the systemctl status user-1000.slice output either. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c23 --- Comment #23 from Simon Lees <simonf.lees@suse.com> --- (In reply to Martin Jambor from comment #22)
Well, I get much shorter output:
mjambor@virgil:~$ systemctl status user-1000.slice ● user-1000.slice Loaded: loaded Active: inactive (dead)
I have installed fluxbox from the package fluxbox from repository http://download.opensuse.org/repositories/X11:/windowmanagers/ openSUSE_Tumbleweed/ I log in with normal xdm.
Based on comment #20, I changed my .xinitrx to run fluxbox with:
exec dbus-run-session -- /usr/bin/startfluxbox
but it did not help and did not change the systemctl status user-1000.slice output either.
Ok i'll try xdm tomorrow, I guess lightdm is setting up the systemd session but xdm isn't -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c26 --- Comment #26 from Simon Lees <simonf.lees@suse.com> --- (In reply to Dr. Werner Fink from comment #24)
(In reply to Simon Lees from comment #23)
Ok i'll try xdm tomorrow, I guess lightdm is setting up the systemd session but xdm isn't
... AFAICR as author of the scripts below /etc/X11/xdm/ the dbus agent as well as agents for ssh/gpg are set up well ... also the scripts include some checks to be able to skip this if an other DM which provides dbus/ssh/gpg agents might use those scripts.
Yep I did some extensive testing with lightdm + xdm and fluxbox, openbox and icewm. It seems your right in every case I tried I got dbus running as a user session so its certainly not a general problem. (In reply to Dr. Werner Fink from comment #25)
Btw: even if the emacs script wouldn't provide a dbus session agent id no one is available there is no method to forbid the user to do this by hand e.g. short after login via ssh. The reason why I've added scripting code to enable a dbus session agent for an emacs is simply to avoid warning about a missing dbus. Later on it has shown that this provides the possiblity to let emacs talk ove rdbus to other components. That is that any permission handling for such a communication should be done well by the policykit.
I think rather then emacs trying to fix this issue itself we should treat the fact that dbus isn't running as a "system bug" that we should fix rather then getting emacs to work around it, as you pointed out other things will probably also be broken as well. As for a ssh we don't currently launch dbus on login, maybe we should, i'll bring that up on the factory mailing list. We do launch a systemd user session for ssh logins though so starting dbus is as simple as "systemctl --user start dbus.service", that way it will be run consistently the same way as with desktops. We might not be able to prevent people from doing it other ways if they choose but we can strongly recommend it. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c27 --- Comment #27 from Simon Lees <simonf.lees@suse.com> --- (In reply to Martin Jambor from comment #22)
Well, I get much shorter output:
mjambor@virgil:~$ systemctl status user-1000.slice ● user-1000.slice Loaded: loaded Active: inactive (dead)
I have installed fluxbox from the package fluxbox from repository http://download.opensuse.org/repositories/X11:/windowmanagers/ openSUSE_Tumbleweed/ I log in with normal xdm.
Based on comment #20, I changed my .xinitrx to run fluxbox with:
exec dbus-run-session -- /usr/bin/startfluxbox
but it did not help and did not change the systemctl status user-1000.slice output either.
Just as a first point of checking is your uid 1000? I've tested with both xdm and lightdm with openbox, fluxbox and icewm which has resulted in dbus running everytime so I guess your system must do something differently somehow. A better way to start dbus would be "systemctl --user start dbus.service" but this won't currently fix the emacs issue as its check for if dbus is running is broken, the correct check is to see if "$XDG_RUNTIME_DIR/bus" is owned the current uid. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c28 --- Comment #28 from Martin Jambor <mjambor@suse.com> --- Created attachment 720945 --> http://bugzilla.opensuse.org/attachment.cgi?id=720945&action=edit Output of systemctl status user-11009.slice (In reply to Simon Lees from comment #27)
Just as a first point of checking is your uid 1000?
Umm, no, sorry, I did not realize that 1000 stood for UID. I have attached output of systemctl status user-11009.slice
I've tested with both xdm and lightdm with openbox, fluxbox and icewm which has resulted in dbus running everytime so I guess your system must do something differently somehow. A better way to start dbus would be "systemctl --user start dbus.service"
I suppose that this is moot given the new systemctl output?
but this won't currently fix the emacs issue as its check for if dbus is running is broken, the correct check is to see if "$XDG_RUNTIME_DIR/bus" is owned the current uid.
I see. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c29 --- Comment #29 from Simon Lees <simonf.lees@suse.com> --- (In reply to Martin Jambor from comment #28)
Created attachment 720945 [details] Output of systemctl status user-11009.slice
(In reply to Simon Lees from comment #27)
Just as a first point of checking is your uid 1000?
Umm, no, sorry, I did not realize that 1000 stood for UID. I have attached output of systemctl status user-11009.slice
Sorry I should have mentioned that
I've tested with both xdm and lightdm with openbox, fluxbox and icewm which has resulted in dbus running everytime so I guess your system must do something differently somehow. A better way to start dbus would be "systemctl --user start dbus.service"
I suppose that this is moot given the new systemctl output?
Yeah the following extract shows its running as expected. └─user@11009.service ├─dbus.service │ └─8763 /bin/dbus-daemon --session --address=systemd: --nofork --nopidfile --systemd-activation -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c31 --- Comment #31 from Martin Jambor <mjambor@suse.com> --- Is there anything else I should try on my system to help move this forward? -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1028893 http://bugzilla.opensuse.org/show_bug.cgi?id=1028893#c32 --- Comment #32 from Martin Jambor <mjambor@suse.com> --- I don't know what happened (I tend to think the newer dbus made it) but after updating, neither my desktop nor my notebook exhibits this annoying behavior. So as far as I am concerned, this can be closed. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com