LinuxQuestions.org
Help answer threads with 0 replies.
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: 122

Rep: Reputation: 58
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-14.2.1 on Lenovo Thinkpad W520
Posts: 8,279

Rep: Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052
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: 122

Original Poster
Rep: Reputation: 58
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-14.2.1 on Lenovo Thinkpad W520
Posts: 8,279

Rep: Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052Reputation: 3052
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, 36 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: 122

Original Poster
Rep: Reputation: 58
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: 34

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, Russia
Distribution: Slackware
Posts: 132

Rep: Reputation: 74
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: slackware 12.2, scientific linux 6.4, knoppix 7.2, salix 14.1
Posts: 1,024

Rep: Reputation: Disabled
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, Russia
Distribution: Slackware
Posts: 132

Rep: Reputation: 74
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 08:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration