LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-06-2016, 05:36 AM   #1
Mitt Green
Member
 
Registered: May 2014
Location: Europe
Posts: 199

Rep: Reputation: 116Reputation: 116
Why do we need DBus?


Hi everyone,

I recently switched from Xfce/GNOME2 to window managers, thus having no longer need in dbus (it's Debian, so I still have a dbus library but not the daemons). I wonder, what are advantages of using dbus.

Let me explain: to change preferences/look of a window manager (or any other programme that doesn't use dbus; xterm for example) one has to edit its configuration file(s). And to change, say, xfwm4/metacity theme (font, etc.) one has to type a command (xfconf-query...), apart from GUI configuration manager, of course, OR to change XML config files manually, but, without dbus running, settings won't work.

So, why don't then these environments (GNOME, KDE, Xfce) only rely on plain text config files for managing their components without need in dbus?

Thanks
 
Old 02-06-2016, 06:16 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
From the same developers as systemd... Dbus originally was just another inter-process communication method that allowed addressing (like rpc services do, but using a different addressing scheme). The developers wormed it into being used for anything and everything. It is embedded in systemd as well. It has been used to pass audio around, configuration options, system daemon to user notifications...

Personally, I prefer simple text files (even XML is overkill, and hard to read as well; so suddenly you get yet another GUI editor for those files...).

One of the issues dbus does address is to separate the X resource database portion of the X server (which still exists) from the X server. This is not necessarily a bad thing, but it does force yet another authentication and authorization problem with X applications working remotely (the "can't contact dbus" is due to the addressing failure between a remote application and the local resource definitions...), which makes some gnome tools act odd.

The problem this causes is that it becomes a problem for the Mate desktop as the Mate toolkit libraries have been being migrated to qt3 (which is a gnome3 library where the dbus connections get involved). Trying to use some of those tools remotely causes problems.
 
Old 02-06-2016, 06:38 AM   #3
Mitt Green
Member
 
Registered: May 2014
Location: Europe
Posts: 199

Original Poster
Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by jpollard View Post
From the same developers as systemd... Dbus originally was just another inter-process communication method that allowed addressing (like rpc services do, but using a different addressing scheme). The developers wormed it into being used for anything and everything. It is embedded in systemd as well. It has been used to pass audio around, configuration options, system daemon to user notifications...

Personally, I prefer simple text files (even XML is overkill, and hard to read as well; so suddenly you get yet another GUI editor for those files...).

One of the issues dbus does address is to separate the X resource database portion of the X server (which still exists) from the X server. This is not necessarily a bad thing, but it does force yet another authentication and authorization problem with X applications working remotely (the "can't contact dbus" is due to the addressing failure between a remote application and the local resource definitions...), which makes some gnome tools act odd.

The problem this causes is that it becomes a problem for the Mate desktop as the Mate toolkit libraries have been being migrated to qt3 (which is a gnome3 library where the dbus connections get involved). Trying to use some of those tools remotely causes problems.
D-Bus is, by the way, maintained by Red Hat. I see some similarities with systemd as well. But D-Bus has been here for long time and I have never really questioned, why should I use it, unlike with systemd case. It's another topic though.

As far as I know, systemd's dbus (sd-bus) is another implementation, like GDBus and QtDBus, built on top of it.

I had some problems with dbus, in particular with permissions and policykit (unable to shutdown and mounting volumes, it was in Xfce and Mate). gvfs is another huge thing, of which I am a bit uncertain.

Mate uses gtk+2, no? Last time I used it was 1.8 though, but since it's "enhanced GNOME2," I reckon, they'll be using it.
 
Old 02-06-2016, 06:57 AM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Mate is moving to gtk3 (http://wiki.mate-desktop.org/status:gtk3), though the project hasn't finished. The advantage for the project is not having to maintain the gtk2 libraries anymore. The disadvantage to the users is that it will come with a good bit of the gnome3 baggage originally avoided.

There is only one dbus - the others are interface libraries added to access it.

Part of gvfs is now missing (the user fuse mount for the gnome configuration), at least in Fedora (but them I'm using gnome2, but see things like gvfsd, gvfsd-http, gvfsd-metadata,.... So it appears to be reimplemented on the /run/user/<uid>/gvfs things that get wiped out on logout. At least backups don't seem to have a problem with it now.

Last edited by jpollard; 02-06-2016 at 06:58 AM.
 
Old 02-24-2016, 02:36 PM   #5
Mitt Green
Member
 
Registered: May 2014
Location: Europe
Posts: 199

Original Poster
Rep: Reputation: 116Reputation: 116
I received a reply, regarding D-Bus, on Xfce forums that is worth sharing, I suppose.
Quote:
Originally Posted by ToZ
dbus is mostly an interprocess communication (IPC) system - a way for applications to talk to each other. For example, xfce4-power-manager uses dbus for:

Quote:
...xfce4-power-manager provides a set of freedesktop-compliant DBus interfaces to inform other applications about the current power level so that they can adjust their power consumption, and it provides the inhibit interface which allows applications to prevent automatic sleep actions via the power manager; as an example, the operating system’s package manager should make use of this interface while it is performing update operations.
...source: http://docs.xfce.org/xfce/xfce4-power-manager/start

xfconf (Xfce's configuration storage system) uses dbus so that it can communicate with other Xfce applications when settings are queried and/or changed and need to be tracked/saved.

Xfce, however, uses xfconf as sort of a "live" configuration management system. On startup, the settings in the xml files are read into memory and managed by the xfconfd daemon. It tracks when configuration changes are made and on shutdown, it writes these changes back to the xml files. It saves the user from having to directly manipulate those files.

Last edited by Mitt Green; 02-25-2016 at 03:30 PM.
 
Old 02-25-2016, 08:39 AM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
yep its communication software got a have it, or simular software to communicate. Just like drivers are communication software.
 
Old 02-25-2016, 01:47 PM   #7
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
You need it only because applications use it. There ARE alternative communications methods. Domain sockets are used for dbus... so dbus itself isn't required, just that the applications use it instead.

Which is more complex to use? Personally, it looks like dbus is.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] using jack2-dbus, jack_control start gives error: DBus exception: org.jackaudio.Error Laertiades Linux - Newbie 7 05-10-2014 05:10 PM
dbus "rm /var/run/dbus/Desktop can't remove..." longus Slackware 6 12-15-2008 03:33 AM
Fedora Core 9 update dbus.exception & dbus.proxies & DBus.Error.AccessDenied errors trien27 Fedora 1 12-08-2008 11:23 PM
dbus-1 = 1.0.0 where do I get it? patsikam Linux - Software 2 11-26-2007 01:13 AM
What is dbus? elvisious Linux - Newbie 1 04-10-2007 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration