emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs insists on starting dbus?


From: Michael Albinus
Subject: Re: Emacs insists on starting dbus?
Date: Tue, 31 Jul 2012 19:49:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Harald Hanche-Olsen <address@hidden> writes:

> Short version: I built emacs with --without-dbus,
> yet when I run emacs -Q, it runs dbus-launch.
>
> Why? Surely, this is not the way it should be?

Nope, it shouldn't.

> Slightly longer version: I am on Ubuntu, fresh emacs source from
> trunk, and ./config.status -V outputs this:
> emacs config.status 24.1.50
> configured by ../configure, generated by GNU Autoconf 2.65,
>   with options "'--without-dbus'
> --prefix=/global/work/hanche/pkg/emacs/2012-07-31' '--with-gif=no'
> --with-x-toolkit=lucid'"

Since you have disabled dbus by configure option, dbusbind.c shouldn't
be linked with the emacs binary.

> And here is what happens:
> ; strace -f -e execve /global/work/hanche/pkg/emacs/current/bin/emacs -Q
> Process 31127 attached
> [...]
> [pid 31127] execve("/usr/bin/dbus-launch", ["dbus-launch",
> "--autolaunch", "2873e88d4c5664b2024eb9654eddd59c", "--binary-syntax",
> "--close-stderr"], [/* 205 vars */]) = 0
> [...]

This would need more debugging. As said, I don't believe that dbusbind.c
is in the way. But there are other libraries known to establish a D-Bus
connection, fx in order to connect to the at-spi bus (I have the feeling
that it might be in the gtk context, but I'm not sure - you configure
for lucid).

You might try to find which processes on the remote host run under D-Bus
control, started by emacs. Something like this:

# sudo grep -l DBUS_SESSION_BUS_ADDRESS /proc/*/environ
# ps -p <pid>     ### for all returned pid's

> A bit of background: This is on a server running as a virtual machine.
> I would like to have an emacs daemon running on this server that I can
> connect to and use (with x11) when I ssh into the machine. But when I
> am done using my emacs windows and have closed them all, ssh still
> hangs around when I log out because the dbus process(es) are hanging
> onto one or two x11 connections tunneled by ssh. The only workaround I
> see is to kill those dbus processes by hand, which is a bother.
>
> I'd file a bug report, but I wanted to ask here first if this is a bug
> or a feature. And if the latter, how do I work around it?

It isn't a feature. But it looks like a side-effect of a third party
library linked with emacs. I see the following options to handle:

- If we know which service(s) autostart D-Bus, we might find a way to
  suppress them.

- The default way to suppress autostart is configuring D-Bus sources
  with --disable-x11-autolaunch before compilation. But I guess you
  don't compile D-Bus yourself, it isn't a real option, therefore.

- You could try to start emacs remotely with an invalid address, like

  env DBUS_SESSION_BUS_ADDRESS="invalid address" emacs --daemon ...

  According to the spec, autolaunch is activated only when
  $DBUS_SESSION_BUS_ADDRESS is unset. Maybe dbus-launch returns an error
  then, which is ignored. Not very elegant, but maybe working.

> - Harald

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]