You are not logged in.

#1 2017-07-05 17:43:02

damo
....moderator....
Registered: 2015-08-20
Posts: 5,059

[SOLVED]helium-dev: root terminal fails to open - no dbus-launch

Terminator fails to open with 'gksudo x-terminal-emulator', or in Thunar r-click menu.

Errors indicate that dbus-launch failed:

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message

'dbus-launch' is included in package 'dbus-x11', so the following action fixed it...

sudo apt-get install dbus-x11

EDIT: there was an issue with terminator and dbus in the past, which until it was patched could be run with no DBus:

terminator -u

In helium-dev (no dbus-x11) the root terminal can be started with

gksudo 'x-terminal-emulator -u'

Obviously this won't work if the terminal isn't terminator.

EDIT 2:  If the $USER's terminator config is copied to '/root/.config, and has  "dbus = False" in the [global_config] section of the config file, then 'gksudo x-terminal-emulator' works OK.

OR edit '/usr/share/terminator/terminatorlib/config.py', and change line #86 in the defaults section to read "'dbus'                  : False,"

Last edited by damo (2017-07-06 03:45:28)


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#2 2017-07-06 02:56:16

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

Thank you - another bug squashed!
(Confirmed in a VM, along with the fix.)

Some dependencies must have shifted moving from jessie to stretch...

...ah yes, for one, network-manager-gnome in Jessie depended on dbus-x11 so that would have brought it in.
Now it depends on default-dbus-session-bus | https://packages.debian.org/stretch/dbus-session-bus . Both of those are virtual packages, but it looks as if their first choice of provider is dbus-user-session, followed by dbus-x11.

dbus-user-session wrote:

On systemd systems, this package opts in to the session model in which a user's session starts the first time they log in, and does not end until all their login sessions have ended. This model merges all parallel non-graphical login sessions (text mode, ssh, cron, etc.), and up to one graphical session, into a single "user-session" or "super-session" within which all background D-Bus services are shared.

Multiple graphical sessions per user are not currently supported in this mode; as a result, it is particularly suitable for gdm, which responds to requests to open a parallel graphical session by switching to the existing graphical session and unlocking it.

To retain dbus' traditional session semantics, in which login sessions are artificially isolated from each other, remove this package and install dbus-x11 instead.

Anyway, I'll add dbus-x11 to the install list - that should stop dbus-user-session from being installed, for better or worse...

EDIT: It might have been nicer if gksu worked with dbus-user-session though... some google-fodder I guess.

Last edited by johnraff (2017-07-06 02:57:19)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#3 2017-07-07 05:11:19

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

I just had a look at Debian Stretch lxde, and they install both dbus-user-session and dbus-x11 FWIW.

Also confirmed that 'gksu urxvt' runs fine without debus-x11, so it does look like a specific terminator thing. I wonder what super powers are enabled by having terminator use dbus? More googling...


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#4 2017-07-07 05:25:35

damo
....moderator....
Registered: 2015-08-20
Posts: 5,059

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

I've also realised that 'dbus = False' can be set in the terminator config, so that could be shipped in skel.


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#5 2017-07-07 08:59:35

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

^Let's try and get an idea if including dbus-x11 would be a plus or a minus, overall...


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#6 2017-07-07 14:35:34

damo
....moderator....
Registered: 2015-08-20
Posts: 5,059

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

johnraff wrote:

^Let's try and get an idea if including dbus-x11 would be a plus or a minus, overall...

Installed-Size: 138 kB
Provides: dbus-session-bus

Hardly a big overhead smile


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#7 2017-07-07 14:47:21

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 735

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

I do find xfce4-appfinder does not start with no dbus session available. When you switch to runlevel 3 to do something then go back to runlevel 5 it kills the dbus session which is not restarted if dbus-user-session is installed. Dbus-x11 makes it work normally so including dbus-x11 in the install makes sense.


Real Men Use Linux

Offline

#8 2017-07-07 14:50:25

DeepDayze
Member
From: In Linux Land
Registered: 2017-05-28
Posts: 735

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

So yes there are apps that DO use dbus out there and providing dbus session support will make them work properly.


Real Men Use Linux

Offline

#9 2017-07-08 06:40:31

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

Yes agreed we definitely need dbus session support, but it looks as if there are now two ways of getting it: dbus-user-session and dbus-x11.

The description I posted above suggests that merging all user login sessions into one "super-session" ala d-u-s might be the way forward (ie less likely to cause problems in the future) while having isolated login sessions ala d-x11 might work better with "traditional" apps.

In other words, I have almost no idea...

Meanwhile LXDE on Debian Stretch installs both (the Debian description seemed to suggest only one should be installed) so for the time being we could follow their lead, install dbus-user-session and dbus-x11, and see if anything breaks.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#10 2017-07-08 06:52:30

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

Interesting: (on Stretch, with dbus-user-session, without dbus-x11)

john@helium-net:~$ sudo su
[sudo] password for john: 
root@helium-net:/home/john# terminator
ConfigBase::load: Unable to open /root/.config/terminator/config ([Errno 2] No such file or directory: '/root/.config/terminator/config')
Traceback (most recent call last):
  File "/usr/bin/terminator", line 105, in <module>
    ipc.new_window_cmdline(optionslist)
  File "/usr/share/terminator/terminatorlib/ipc.py", line 177, in _exec
    bus = dbus.SessionBus()
  File "/usr/lib/python2.7/dist-packages/dbus/_dbus.py", line 211, in __new__
    mainloop=mainloop)
  File "/usr/lib/python2.7/dist-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally without any error message

(usr/bin/dbus-launch does not exist.) So root seems to need dbus-launch to open terminator at all, but an ordinary user can. (It opens behind the current window, but I suppose that's another issue.)


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#11 2017-08-31 08:16:02

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

johnraff wrote:

It opens behind the current window, but I suppose that's another issue.

It looks like a known bug, again dbus-related: https://bugs.launchpad.net/terminator/+bug/1508531

Anyway, the same "dbus = False" in user's config fixes it.

I suppose we still need to keep dbus-x11 for the gksu issue - adding config to /root/.config works too, but we'd then have the responsibility of writing a good terminator config for root (at least get the red banner back).


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#12 2017-08-31 20:14:50

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

Just make it look different somehow, so that I can tell at a glance it is a root window.

I have noticed odd behavior with terminator as well. Not just the new window not raising focus properly, but when alt-tabbing or clicking to focus the terminal, all of the terminal instances are coming forward. That's not so great when I tile one monitor almost completely out with terminator instances running mocp, journalctl -xf and also tailing .xsession-errors. I suppose I should have openbox pin them down low so they don't pop up like that.

Offline

#13 2017-08-31 23:18:05

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

tknomanzr wrote:

...but when alt-tabbing or clicking to focus the terminal, all of the terminal instances are coming forward.

Is that fixed if you add

dbus = "False"

under [global_config] in ~/.config/terminator/config?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#14 2017-09-01 00:39:26

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

^ Yes, that fixed it. Thanks for the  tip.

Offline

#15 2017-09-01 00:48:23

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

I think we'll need to add that setting to our default user configs.
I don't know if anything useful is lost by disabling dbus for terminator, but users will always be able to re-enable it.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#16 2017-09-01 06:23:00

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

Why would a terminal emulator need dbus?  yikes

This "feature" encourages users to open a graphical desktop application (the terminal emulator) as root, this is bad practice.

It is *much* better to open the graphical desktop application (the terminal emulator) as a normal user and employ the `sudo` command to attain elevated privileges, surely?


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#17 2017-09-01 08:00:45

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 5,740
Website

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

Since you clearly feel the "Open Root Terminal Here" option is a Bad Thing, perhaps you'd like to open a new thread explaining why you advocate this change to our long-standing feature (since CrunchBang)? Nothing here is carved in stone...

What is the connection between this and dbus, though? 'gksu terminator' works equally well if root has disabled dbus in terminator's config.


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#18 2017-09-01 13:29:50

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: [SOLVED]helium-dev: root terminal fails to open - no dbus-launch

This fixed it for the virtual machine instance I was running as well. I didnt care for the whole windows not focusing properly thing. Glad that fixes it.

Offline

Board footer

Powered by FluxBB