From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Emacs insists on starting dbus? Date: Tue, 31 Jul 2012 19:49:49 +0200 Message-ID: <871ujr2536.fsf@gmx.de> References: <20120731.164910.1735362134333062173.hanche@math.ntnu.no> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1343757012 6812 80.91.229.3 (31 Jul 2012 17:50:12 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 31 Jul 2012 17:50:12 +0000 (UTC) Cc: emacs-devel@gnu.org To: Harald Hanche-Olsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 31 19:50:12 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SwGa9-0001fL-7k for ged-emacs-devel@m.gmane.org; Tue, 31 Jul 2012 19:50:09 +0200 Original-Received: from localhost ([::1]:45219 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwGa8-0007GY-7t for ged-emacs-devel@m.gmane.org; Tue, 31 Jul 2012 13:50:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwGa4-0007F8-MA for emacs-devel@gnu.org; Tue, 31 Jul 2012 13:50:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwGa2-0007xK-8W for emacs-devel@gnu.org; Tue, 31 Jul 2012 13:50:04 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.22]:43922) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1SwGa1-0007u4-Um for emacs-devel@gnu.org; Tue, 31 Jul 2012 13:50:02 -0400 Original-Received: (qmail invoked by alias); 31 Jul 2012 17:49:57 -0000 Original-Received: from p57BB9539.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [87.187.149.57] by mail.gmx.net (mp028) with SMTP; 31 Jul 2012 19:49:57 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1/oDZI8KMHojdCGPwcO8fO9umtEa3xQl9GlGMT0k2 EDGwky5ClAEwBK User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152018 Archived-At: Harald Hanche-Olsen 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 ### 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.