From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brendan Tildesley Subject: Programs like pcmanfm, evince, ... don't connect to dbus unless run with dbus-launch Date: Thu, 2 Aug 2018 16:21:02 +1000 Message-ID: <4cb02345-ff28-02e5-63f7-3df78585e4b9@openmailbox.org> References: <2c04ce67-5606-35b3-4f26-7d4c349af97e@openmailbox.org> <20180731235419.7b824b45@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43365) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fl6z1-0001wK-Kl for guix-devel@gnu.org; Thu, 02 Aug 2018 02:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fl6yy-0000ZH-F0 for guix-devel@gnu.org; Thu, 02 Aug 2018 02:21:11 -0400 Received: from lb1.openmailbox.org ([5.79.108.160]:44293 helo=mta-1.openmailbox.org) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fl6yy-0000Wz-8Y for guix-devel@gnu.org; Thu, 02 Aug 2018 02:21:08 -0400 In-Reply-To: <20180731235419.7b824b45@scratchpost.org> Content-Language: en-AU List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" Cc: guix-devel On 08/01/18 07:54, Danny Milosavljevic wrote: > Hi, > > dbus is an object-oriented inter-process-communication mechanism. > > On a typical single-user system there's one user bus, at least one sess= ion > bus and one system bus. > > On a typical multi-user system there's multiple user buses, at least as= many > session buses and one system bus. > > >From your messages I suspect that the dbus session bus for your sessio= n is not > running. > > Try invoking > > echo $DBUS_SESSION_BUS_ADDRESS > > . > > If it's empty, no session bus is running. > > Many many GNOME parts try to use dbus for everything (also arguably for > things which would work perfectly well without dbus, but whatever). > > dbus-launch is used to start a message bus from a shell script. > > It's usually chained together like this (that's how I use it for real): > > $ exec dbus-launch ssh-agent fluxbox > > This means that dbus-launch will set up some environment variables, > invoke the daemon and then invoke dbus-daemon and then invoke the > child (here, ssh-agent, passing it "fluxbox"), passing it the environme= nt. > > If you invoke "dbus-launch evince" it's starting a mini-session bus > and in there invokes evince. Evince then cannot connect to the other > services in your session (because there are no other such services in > this mini-session). > > I think modifying the slim service to use dbus-launch when starting > the session should have worked just fine. > >>> I tried modifying the slim service to launch the session with >> dbus-launch, but that only served to create some new errors when runni= ng >> pcmanfm: > Yes, but what does > > echo $DBUS_SESSION_BUS_ADDRESS > > say now? > >> invoking IsSupported() failed for remote volume monitor with dbus name > ^^^^^^ ??? > > Also, here, it's not finding lots of service files. Something needs to= make > sure that the dbus daemon finds the service files. Usually we have an = environment > variable for that (see further below). > > There are system services in /etc/dbus-1/system-services which should b= e found in > all cases. > > Among those is org.freedesktop.UDisks2 which is not org.gtk.vfs.UDisks2= VolumeMonitor . > > org.gtk.vfs.UDisks2VolumeMonitor is not in the directory /etc/dbus-1/sy= stem-services . > > Then there's the ~/.guix-profile/share/dbus-1/services directory. > > ~/.guix-profile/share is one of the XDG_DATA_DIRS. > > dbus-specification.xml specifies that $XDG_DATA_DIRS/dbus-1/services is= to be > searched by the user bus. > > But this directory only contains files of packages that I personally in= stalled > into my profile - not of the dependencies. In this case I didn't insta= ll the > package of org.gtk.vfs.UDisks2VolumeMonitor - so the service file resid= es in > /gnu/store/85ih21qjgqcicjkqkw5v96wjvh9hq9g3-gvfs-1.32.1/share/dbus-1/se= rvices/org.gtk.vfs.UDisks2VolumeMonitor.service . > > I wonder why it works with the GNOME desktop. Does it really? > > Possible workaround: > > youruser$ guix package -i gvfs I've always had gvfs installed and it hasn't made any difference as far as I can tell > > Possible fix: > > Make nautilus and other Guix packages using gvfs propagate gvfs. > > Possible different fix: > > Add profile hook which also automatically provides service files of dep= endencies > without installing the packages into the profile. I'm not sure how use= ful that it > since dbus will prefer a running service to service files anyway (I thi= nk). But > at least we would notice a conflict. > Also, is it able to statically determine what these dependencies are? Previously there was no $DBUS_SESSION_BUS_ADDRESS. After I modified slim to add dbus-launch, I have DBUS_SESSION_BUS_ADDRESS=3Dunix:abstract=3D/tmp/dbus-Rc7AP3Xnzz,guid=3D97= d26aba11773a9ce755829b5b611375 but it didn't fix the issue, and caused those weird errors. Actually I'm not getting those errors anymore, maybe due to reconfiguring and rebooting. When I run `dbus-launch bash` , it overwrites that value with a new value in the current environment: unix:abstract=3D/tmp/dbus-1vzMgxAURi,guid=3D98eb63bd2e22340a0c1d3bd85b611= 6d5 =A0and then running pcmanfm/evince only from that bash shell works fine, running outside it or from dmenu doesn't.