You are not logged in.

#1 2014-02-07 06:49:55

youngian
Member
Registered: 2012-08-06
Posts: 26

Automounting problems, or: What is dbus doing?

This all started with trying to figure out why Thunar can't automount, but my suspicion is that the underlying cause is that something is screwed up with dbus on my system. I keep running into problems that all end up tracing back to something dbus-related, so I'd like to figure out the root of the issue once and for all.

Here's what I have figured out so far: after boot, $DBUS_SESSION_BUS_ADDRESS is set, but $DBUS_SESSION_BUS_PID is not, and Thunar cannot automount. If I run this:

eval $(dbus-launch --sh-syntax --exit-with-session)

Then both of those vars are set, and Thunar can automount.

So what's going on, exactly? Are the details I've gathered relevant? It seems like dbus isn't starting fully the first time...? It should be starting on boot via this rule (which gets loaded from my .xinitrc):

/etc/X11/xinit/xinitrc.d/30-dbus:

if [ -z "$DBUS_SESSION_BUS_ADDRESS" ] && type dbus-launch >/dev/null; then
  eval $(dbus-launch --sh-syntax --exit-with-session)
fi

Offline

#2 2014-02-07 07:11:31

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Automounting problems, or: What is dbus doing?

Do you have an active login session? How do youn login? What WM/DE are you using? Why do you have the 30-dbus rule: what problem is it trying to solve?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2014-02-07 07:35:39

youngian
Member
Registered: 2012-08-06
Posts: 26

Re: Automounting problems, or: What is dbus doing?

jasonwryan wrote:

Why do you have the 30-dbus rule: what problem is it trying to solve?

As far as I know, that rule was just put there by some package - I don't think I ever added or edited it manually.

jasonwryan wrote:

Do you have an active login session? How do youn login? What WM/DE are you using?

I'm using XFCE. Automatically logged in by SLiM. Not sure what an "active login session" means - like am I logged in when I check this? Yeah, it's all within my normal XFCE desktop session - opening shells and running Thunar from there.

Offline

#4 2014-02-07 07:42:02

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Automounting problems, or: What is dbus doing?

You can check your session with:

loginctl show-session $XDG_SESSION_ID

I don't have that, or any, dbus rules and automounting works fine (with no session bus PID).


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2014-02-07 08:00:45

youngian
Member
Registered: 2012-08-06
Posts: 26

Re: Automounting problems, or: What is dbus doing?

I should also mention that my .xinitrc, to start XFCE, has simply

exec startxfce4

I've seen other threads where people prepend that with `dbus-launch`, but I figure if dbus is already being started elsewhere, I probably shouldn't hack my way out of this by forcing it to start twice.

Offline

#6 2014-02-07 08:10:58

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Automounting problems, or: What is dbus doing?

So, is your login session working (active), or not?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2014-02-07 09:53:44

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: Automounting problems, or: What is dbus doing?

the script '/etc/X11/xinit/xinitrc.d/30-dbus' is not automatically launched by .xinitrc ;
you need to use the model in '/etc/skel/.xinitrc' by copying it in place of your present .xinitrc and uncommenting the line to run xfce4.

Offline

#8 2014-02-07 17:09:20

youngian
Member
Registered: 2012-08-06
Posts: 26

Re: Automounting problems, or: What is dbus doing?

jasonwryan wrote:

So, is your login session working (active), or not?

Yeah, it logs me in just fine.

berbae wrote:

the script '/etc/X11/xinit/xinitrc.d/30-dbus' is not automatically launched by .xinitrc ;
you need to use the model in '/etc/skel/.xinitrc' by copying it in place of your present .xinitrc and uncommenting the line to run xfce4.

Yes, I'm doing so. I've now also started recording what's going on and I can see that my xinitrc is running this rule and it is setting $DBUS_SESSION_BUS_ADDRESS (though not, for some reason, $DBUS_SESSION_BUS_PID). Here's my full .xinitrc for posterity:

#!/bin/sh

echo "$DBUS_SESSION_BUS_ADDRESS" >> ~/junk # This one is blank

# Source scripts in /etc/X11/xinit/xinitrc.d/
if [ -d /etc/X11/xinit/xinitrc.d ]; then
    for f in /etc/X11/xinit/xinitrc.d/*; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi

echo "$DBUS_SESSION_BUS_ADDRESS" >> ~/junk # This one has an address

setxkbmap -option compose:rwin

exec startxfce4

Offline

#9 2014-02-07 18:59:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Automounting problems, or: What is dbus doing?

youngian wrote:
jasonwryan wrote:

So, is your login session working (active), or not?

Yeah, it logs me in just fine.

Sigh. What is the output of the one-liner I posted? Do you have an active session, or not?


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2014-02-07 21:43:06

youngian
Member
Registered: 2012-08-06
Posts: 26

Re: Automounting problems, or: What is dbus doing?

jasonwryan wrote:

Sigh. What is the output of the one-liner I posted? Do you have an active session, or not?

Sorry, I somehow overlooked that part of your post, my mistake.

$ loginctl show-session $XDG_SESSION_ID
Id=1
Timestamp=Fri 2014-02-07 12:33:58 PST
TimestampMonotonic=11779859
VTNr=7
Display=:0.0
Remote=no
RemoteUser=root
Service=slim
Scope=session-1.scope
Leader=482
Audit=1
Type=x11
Class=user
Active=yes
State=active
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
Name=youngian

Offline

#11 2014-02-07 22:11:41

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Automounting problems, or: What is dbus doing?

So, with an active session, remove the dbus rule and use udisk{s,ie} to handle automounting and you are done.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#12 2014-02-07 22:30:33

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Automounting problems, or: What is dbus doing?

jasonwryan wrote:

So, with an active session, remove the dbus rule and use udisk{s,ie} to handle automounting and you are done.

It's not a rule, it's a script and it's the usual way of starting dbus.

Offline

#13 2014-02-07 22:44:11

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Automounting problems, or: What is dbus doing?

Raynman wrote:
jasonwryan wrote:

So, with an active session, remove the dbus rule and use udisk{s,ie} to handle automounting and you are done.

It's not a rule, it's a script and it's the usual way of starting dbus.

Usual? Really? I've never encountered it (which doesn't mean I don't believe you, I'm just surprised that none of my systems have it and they all work fine).

Brain fart. Disregard; I thought the OP had that script somewhere else entirely. tongue

Last edited by jasonwryan (2014-02-07 22:46:50)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#14 2014-02-08 22:05:52

youngian
Member
Registered: 2012-08-06
Posts: 26

Re: Automounting problems, or: What is dbus doing?

Thanks for your work so far, folks. I can probably get some sort of workaround in place with udiskie if I'm desperate, but I'm still hoping I can get to the root of this problem. Of course, if I'm starting dbus the correct way, I'm not sure where that leaves me.

I did notice one other bit of quirky behavior: I mentioned earlier that I can run `eval $(dbus-launch --sh-syntax --exit-with-session)` manually in a shell, and then start Thunar from that shell and have automounting. I just noticed, however, that when I do that automounting appears but the Trash option in the left sidebar "Places" list disappears. Which sorta brings me back to my initial complaint - I suspect there is something haywire about my dbus, and I'm sick of trying to patch up the symptoms, but I don't understand anything about how dbus works well enough to troubleshoot it very well.

Offline

#15 2014-03-07 07:33:58

youngian
Member
Registered: 2012-08-06
Posts: 26

Re: Automounting problems, or: What is dbus doing?

Giving this a bump to get some eyes on it. I would love any advice on what might be causing this, or what dbus has to do with any of this.

Offline

Board footer

Powered by FluxBB