Welcome, Guest. Please login or register.
Did you miss your activation email?

Author Topic: [EN] How to disable dbus services?  (Read 36534 times)

timc

  • Guest
[EN] How to disable dbus services?
« on: 2014/02/01, 14:37:33 »
I have been having trouble for weeks with very slow boot up times. Last evening, I reapproached the problem. Systemd-analyze timed a boot up at 83 seconds.


I discovered that, although I had disabled network-manager in systemd, dbus was spending time looking for it. I could not find a "clean" way to prevent this, so I renamed the dbus service files in /user/share/dbus-1/system-services for network-manager and modem-manager. The next bootup was down to 44 seconds.


Then, I found that Avahi-daemon was taking a long time to start, so I disabled it in systemd. Now, my bootup is down to 23 sec. Much, much better.


Does anyone know the proper way to disable the dbus system services? I'm sure that renaming their service files is not the correct way.


Tim

Offline piper

  • User
  • Posts: 1.785
  • we are the priests ... of the temples of syrinx
Re: How to disable dbus services?
« Reply #1 on: 2014/02/02, 00:45:03 »
I think you have a choice, example

Code: [Select]
systemctl stop dbus.service

*Should* work

Other dbus-services would be

dbus-org.freedesktop.Avahi.service     
dbus-org.freedesktop.hostname1.service
dbus-org.freedesktop.locale1.service   
dbus-org.freedesktop.login1.service   
dbus-org.freedesktop.timedate1.service

You can probably use

Code: [Select]
systemctl list-unit-files
to see what's going on.

To see if dbus is enabled, try

Code: [Select]
systemctl is-enabled dbus.service
or if needed to start at bootup

Code: [Select]
systemctl enable dbus.service 

To see if any failed units     

Code: [Select]
systemctl --failed                 
Free speech isn't just fucking saying what you want to say, it's also hearing what you don't want to fucking hear

I either give too many fucks or no fucks at all, it's like I cannot find a middle ground for a moderate fuck distribution, it's like what the fuck

Offline devil

  • Administrator
  • User
  • *****
  • Posts: 4.838
Re: How to disable dbus services?
« Reply #2 on: 2014/02/02, 01:41:26 »
Mine is ok, for a workstation with a lot of stuff.  That is OCZ Vertex 3 SSDs
Code: [Select]
Startup finished in 12.432s (kernel) + 7.287s (userspace) = 19.720s

greetz
devil


timc

  • Guest
Re: How to disable dbus services?
« Reply #3 on: 2014/02/02, 02:57:24 »
Thank you, piper. systemctl has a lot of depth to the things it handles.

Tim

Offline sunrat

  • User
  • Posts: 406
Re: How to disable dbus services?
« Reply #4 on: 2014/02/02, 03:09:42 »
I, for one, welcome our new systemd overlords. :)

Thanks for mentioning systemd-analyze, timc. I learn new things every day.

Guess my system doesn't have a lot of stuff yet. OCZ Vertex 2.
Code: [Select]
Startup finished in 3.742s (kernel) + 7.600s (userspace) = 11.343s

Offline devil

  • Administrator
  • User
  • *****
  • Posts: 4.838
Re: How to disable dbus services?
« Reply #5 on: 2014/02/02, 21:04:20 »
here is some more reading on optimizing boot times:
http://freedesktop.org/wiki/Software/systemd/Optimizations/

Besides that, the manpage to systemd-analyze has some more clues.
Code: [Select]
systemd-analyze blame shows where there is room for optimization. On my notebook ntp took forever (> 30s). Now it is gone.
Bootcharts can be visualized by:
Code: [Select]
systemd-analyze plot > plot.svg; inkscape plot.svgOf course inkscape needs to be installed, works with konqueror as well. Have fun playing around, there is much more.

greetz
devil
« Last Edit: 2014/02/02, 21:46:52 by devil »

timc

  • Guest
Re: How to disable dbus services?
« Reply #6 on: 2014/02/02, 22:47:43 »
devil, you can also just open those .svg plots in a web browser.

So, here is where things have progressed since my last report:

1) Disabled cron, mdadm, and preload services.
2) Discovered that, even though I have not been running network-manager for weeks, nm-applet was still being started. Found and moved nm-applet.desktop to stop this.
3) Disabled ssh
4 Purged package pywwetha

Then I discovered a usbmount bug (Debian bug 658028). agaida helped me find file /etc/umount/umount.conf, which I edited to say "ENABLED=0".

I think things are optimized pretty well, at least until I go digging some more. My bootup is now down to 17-18 seconds.

Tim

Offline devil

  • Administrator
  • User
  • *****
  • Posts: 4.838
Re: How to disable dbus services?
« Reply #7 on: 2014/02/03, 00:16:21 »
The stuff I read pointed to /run/log and file:///run/log/ as the URL, but /run/log just stays empty here. So far no clue where the stuff really goes and not enough time ...… :(


greetz
devil

Offline sunrat

  • User
  • Posts: 406
Re: How to disable dbus services?
« Reply #8 on: 2014/02/03, 17:32:43 »
systemctl mask seems to be an effective way to disable services and is reversible with unmask eg. -
Code: [Select]
systemctl mask lvm2-activation.serviceResult with ntp and lvm related services masked:
Code: [Select]
Startup finished in 3.542s (kernel) + 3.724s (userspace) = 7.266s