LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-09-2018, 03:15 AM   #1
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Rep: Reputation: 87
disabling D-Bus


Following is probably well-known by many, but it took me some time to figure it out, so I'll write it here for reference:

I wanted to disable D-Bus on my laptop, and all the stuff that it pulls in (ConsoleKit, PolicyKit, gconfd), however I found that "chmod ugo-x" on /etc/rc.d/rc.messagebus and /etc/rc.d/rc.consolekit has no effect, as D-Bus daemon would get started somehow anyway. So after some searching, I found it's possible to disable its launching by setting DBUS_SESSION_BUS_ADDRESS environment variable to some string that is not valid filesystem path (or something similar, as I tried with /dev/null and it worked too). Alternatively, one could of course just "chmod ugo-x /usr/bin/dbus-daemon".

I found that PulseAudio is not working afterwards, however here D-Bus seems just to be used by some PulseAudio modules, so I commented out loading Bluetooth and ConsoleKit modules in /etc/pulse/default.pa, and if works fine now.

If someone has alternate suggestions on how to achieve this, I'd like to hear.
 
Old 01-09-2018, 03:56 AM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Just edit the /usr/bin/start<graphical environment> that you use to remove or comment out the dbus launch code snippet.

e.g. in /usr/bin/startwmaker you will see this:
Code:
 if [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
   eval `dbus-launch --sh-syntax --exit-with-session`
fi
Of course if you don't use any graphical environment this is pointless

But if you use Lumina, if I understand well you won't need this plumbing anyway as they don't use it.

Last edited by Didier Spaier; 01-09-2018 at 03:58 AM.
 
Old 01-09-2018, 04:16 AM   #3
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Original Poster
Rep: Reputation: 87
Thanks for the hint.

I'm still somewhat confused how it get started in my case. Namely, I'm using Openbox. My machine boots into runlevel 3, and then I have .bash_login set up so that if I login at tty1, it would run xinit, that in turn would find in my ~/.xinitrc that it should exec openbox-session. The Openbox scripts don't mention dbus-launch, and according to pstree output, it doesn't seem to be active after X started. However, as soon as I start any GTK program (I'm using Emacs, Firefox and Xpdf - I think all of these are GTK3 by now), dbus-daemon would appear in the pstree output, accompanied by all the other fellas: ConsoleKit and PolicyKit daemons, gconfd daemon, and even some accessibility daemons in case Emacs launched.
 
Old 01-09-2018, 04:50 AM   #4
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
I didn't dig but assume that these apps do use some mechanism to do so, like dbus-glib.

Out of curiosity I did this to find which packages depend on dbus in Slackware64-14.2:
Code:
wget http://slackware.uk/salix/x86_64/slackware-14.2/PACKAGES.TXT
grep -B4 dbus, PACKAGES.TXT|grep NAME|sed "s/.* //;s/-[^-]*-[^-]*-[^-]*$//" > packages_depending_on_dbus.txt
The output is attached. Maybe you can compile some of them without dbus if there is a configure option to do that. Good luck.

PS grepping "dbus," may be makes miss a few, but you get the idea.
Attached Files
File Type: txt packages_depending_on_dbus.txt (1.7 KB, 146 views)

Last edited by Didier Spaier; 01-09-2018 at 04:55 AM.
 
Old 01-09-2018, 05:25 AM   #5
cgorac
Member
 
Registered: Oct 2009
Posts: 146

Original Poster
Rep: Reputation: 87
Quote:
Originally Posted by Didier Spaier View Post
I didn't dig but assume that these apps do use some mechanism to do so, like dbus-glib.
Yeah, probably. It seems to me that GTK is more "problematic" toolkit than Qt in the sense that the separation between the toolkit and the desktop environment that is based on the toolkit is more blurred, so applications written using the toolkit often inadvertently end up depending on corresponding desktop environment technologies.

In any case, it's early to tell but it seems that apps that I use work fine (admittedly, it's also rather small sample, as I actually spend most of my day in xterm) with the setup described above, so there is no need to recompile anything. Still, it would be nice if the whole thing was designed to be fully optional.
 
Old 03-07-2018, 02:41 PM   #6
ernobe
Member
 
Registered: Nov 2004
Location: Costa Rica
Distribution: Debian SID
Posts: 37

Rep: Reputation: 15
On Debian SID, I have dbus disabled by not installing dbus-user-session (it is recommended by the pulseaudio package), or dbus-x11, which automatically brings up dbus on X startup.

EDIT: Oops just realized this is a Slackware forum. Anyway, dbus-x11 is Debians' package containing dbus-launch, which is what programs use to automatically launch dbus. Just removing it ought to solve your unwanted dbus problems. If you still have problems with it on the (non-X) console, consider switching your init system (on Debian switch from using systemd-sysv to sysvinit-core).

Last edited by ernobe; 03-08-2018 at 10:10 AM.
 
Old 03-07-2018, 03:12 PM   #7
slalik
Member
 
Registered: Nov 2014
Location: Moscow
Distribution: Slackware
Posts: 233

Rep: Reputation: 203Reputation: 203Reputation: 203
I do the following:
Code:
# chmod -x /usr/bin/dbus-launch
# chattr +i /usr/bin/dbus-launch
and, of course,
Code:
# chmod -x /etc/rc.d/rc.messagebus
Also, I put the following to /etc/rc.d/rc.local:
Code:
# Ensure the existence of /var/lib/dbus/machine-id
if [ -x /usr/bin/dbus-uuidgen -a ! -x /etc/rc.d/rc.messagebus ] ; then
  echo "Ensure that /var/lib/dbus/machine-id exists: /usr/bin/dbus-uuidgen --ensure"
  /usr/bin/dbus-uuidgen --ensure
fi
 
Old 03-08-2018, 09:48 AM   #8
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
Quote:
Originally Posted by slalik View Post
I do the following:
Code:
# chmod -x /usr/bin/dbus-launch
# chattr +i /usr/bin/dbus-launch
Don't understand what the purpose to set 'i' attribute for executable. I mean what kind of process can change this file again to be executable? If there is such process I consider this as serious security gap. I mean say something is trying to run dbus-lunch - but can't - it should possible send signal - go sleep - or terminate with information in syslog - or its own log file - that something is missing. Such kind of things.
 
Old 03-08-2018, 11:22 AM   #9
slalik
Member
 
Registered: Nov 2014
Location: Moscow
Distribution: Slackware
Posts: 233

Rep: Reputation: 203Reputation: 203Reputation: 203
Quote:
Originally Posted by igadoter View Post
Don't understand what the purpose to set 'i' attribute for executable. I mean what kind of process can change this file again to be executable?
Upgrade of the dbus!
 
  


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
getting bus error massy Linux - Networking 2 07-23-2014 02:32 PM
Dbus System bus and Session bus mainloops deimus Linux - Distributions 0 08-20-2010 06:49 AM
Bus ID phoenix_wolf Linux - Newbie 1 12-17-2004 11:42 AM
Bus ID p0rt Linux - Hardware 1 06-27-2003 03:34 PM
Bus error anamika123 Linux - General 2 08-01-2002 04:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:54 PM.

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