Will your installation work without dbus? by: Anti-DBus

Remove DBus, ConsoleKit, PolicyKit, PAM, new udev, systemd, freedesktop cancer

by: Anti-DBus

Greetings. I have completed a successful DBus removal. Stragglers were ghostscript-gpl, which was removed, cups, which was also removed and all the dependent programs recompiled to live without it, changing it for lprng (the old Berkeley printer spooler, updated), barring icedtea-bin, which was changed to icedtea and built without any build time dependency, sgt-puzzles (removed), winetricks (sadly removed), qtwidgets (all the programs that needed it were recompiled to not to), qtbittorrent (changed for rtorrent as rutorrent has php and bloat), libreoffice (changed for openoffice-bin, as amazingly it doesn’t have need for dbus or even GTK3; it was chosen to avoid sketchy Chinese poor support and paid support office suites such as WPS and Softmaker), notification-daemon (I actually never used it for anything, ever, as redshift pops up its icon without a notification), nvidia-drivers (recompiled without tools), and such.

Beside removing DBus, I also removed ConsoleKit, PolicyKit, qtwidgets, and PAM. The only thing that remains to be removed is udev, changing it for mdev or even static dev, and possibly dhcpcd, switching it for a static configuration.

It is good to see people decrying DBus, systemd and such cancers for what they really are.

editor: Interesting project. What system was this done on? Devuan?

this project was done on Gentoo. On almost any other OS, it would have required installing and manually maintaining a patched GTK3 without at-spi2-whatever dependencies.

There are things that will be missed, for example, video editors. Blender and Inkscape do work, according to emerge -(-)p(retend). Firefox stays alive.

I can install games such as FreeCiv and others after disabling the qt5 USE flag (curiously, as GTK is regarded as more dbus-dependent: this qt dependency is due of qtwidgets with GTK USE flag, qtgui with DBus USE flag [which turns itself on even though my global make.conf has -dbus], and by freeciv itself, which tries to hook itself into DBus if it has the qt5 and -dedicated USE flags set)

Icedtea didn’t let my system be updated because of the cups build-dependency, however, I masked (impeded from being considered for updates or for installs, etc; elogind is also masked, alongside systemd’s udev) xdg-utils (to add to the dbus mask), which made the build dependency complaint stop (apparently, masking enough of the cancerous tree [DBus, xdg-utils, and Net-DBus {a perl module, for what reason??}] is enough for packages to stop wanting them).

Because of no gconf/dconf (the first has deeper cancerous roots, needing consolekit and policykit too), random binaries downloaded from the Internet may not work, some projects will be uncompilable (I think that generally these are the same ones whose binaries need gconf/dconf/libnotify/etc), and those who try to enable notifications, even if you have the Intention of disabling them, are stalled by the lack of libnotify.

As you are free of consolekit (and PAM), your “Last login” line is like so:
“Last login: (day) (date, in the form of, for instance, “Fri Jan 14″) (hour, with seconds) (GMT offset) (year) on (block device [for example, /dev/tty3]).”

As I had menctioned before, winetricks had to go, and that means that you will need to track down all the necessary windows libraries, etc, on your own (or scrape a winetricks online link list, and use those links).

Thanks to the power of source compilation, and the robust Portage package manager (and USE flags, etc), several-many formerly DBus enslaved programs are now free.

However, Libreoffice is an exception. Did you know that it requires, by the way of its KDE frameworks dependencies, ConsoleKit and PolicyKit, and thus DBus, even leaving its gconf/otherconf dependency aside, even with the kde flag disabled locally on it? This was almost fixed by a careful run of “USE=”-kde -gtk -gtk2 -dbus -cups -seccomp” emerge -p –autounmask-keep-masks libreoffice”: the USE section is to set local USE variables (BTW, -seccomp is to stop a whiny Kscreenlocker wanting PAM because of that particular flag), so to not make a file that specifies them for the particular package (/etc/portage/package.use[/* if you use files instead of a big list]) or globally (/etc/portage/make.conf), and –autounmask-keep-masks is to skip the attempted unmasking of pestering packages. This reduced the amount of cancer dependencies to 1 (xdg-utils), but 4 in practice, as xdg-utils pulls in DBus, with Net-DBus alongside it, ConsoleKit, and PolicyKit too.

Curiously, even programs compiled without DBus support opened dbus-launch instances, and killing these also killed the program. They may have been spawned by the unpatched GTK3. The affected programs work flawlessly now.

This is a general summing up of what has happened. I was using i3wm when I decided to make this change. I may switch to CDE (yes, the Common Desktop Environment itself, at https://sourceforge.net/projects/cdesktopenv/; something to note is that dtlogin, the login manager, can support PAM as of the last update ever released by the Open Group [2.1{.X?}], back in 1999. The usage of PAM is defined as “NO” [aka off] in dtlogin’s source [all of CDE is under the LGPLv2, as with Motif.

I hope that you all can manage to escape DBus and such cancers successfully.

Peace.

23 thoughts on “Will your installation work without dbus? by: Anti-DBus

  1. Maybe get rid of avahi and pulse? I mean, as long as you’re at it…

    Like

  2. Kirill Timofeev, I have never cared for automounting USB drives. Every time I used these functions, they mounted on /media, in a rather random directory name. What if I need to take things out of them without a file manager, for example on the CLI, with ease, on a known directory name? It’s better for me to manually mount them in /mnt. Thus, I do so.

    Like

  3. Kirill Timofeev, yes, I do think that it’s possible. I have heard that “pmount” apparently can do it.

    As the Devuan wiki suggests on this (https://git.devuan.org/dev1fanboy/Upgrade-Install-Devuan/wikis/devuan-without-dbus), you can assign /dev/sdXy to a static directory, and add this linking on /etc/fstab, so you can mount -v the directory.

    I tried making dummy libraries of GConf, CUPS and DBus. I first wrote the GConf library with several repeats of “dummy” and “filler”. It said that the ELF header was incorrect, so I pasted another library into the dummy GConf’s place. It failed, because it was 32 bits, so I pasted another 64 bits library. I did the procedure again for the CUPS and DBus fake libraries. Sadly, the program in question (the new Minecraft launcher) complained to me that a symbol used by GConf was missing. IIRC, it was “gconf_open_account/session”. I deleted the fake libraries.
    Another note: I have tested that they work on /lib32 and /lib64, but they do not work in /usr/local/libXX, and may work in /usr/libXX.

    On a separate note, I may need to reinstall ghostscript-gpl, as GutenPrint includes CUPS filters (cannot be used, as DBus, XDG-Utils, and Net-DBus are pulled along, with ConsoleKit and PolicyKit too), FoomaticDB files (cannot be used, as IIRC it also pulls DBus), and GhostScript filters. The GhostScript filters can be linked to LPRng, from there recognizing the printer(s). GutenPrint has drivers for some printers that are generally close to my desktop. After emerge -p’ing ghostscript-gpl, I curiously saw that it requires zero of the “cancer-stack”: apparently the lack of the string of dependencies neutralizes ghostscript-gpl.

    Like

  4. Thanks a bunch for the detailed response Anti-DBus! May I ask you what do you use to manage network connections? NetworkManager will not work without dbus so I wonder what can be replacement?

    Like

  5. Kirill Timofeev, I use DHCPCD, although I may change it for a manual, static configuration (I use DHCPCD in case of sudden IP changes [which, so far, have never happened: my IPs have always been static, and in the case of the ISP I’m currently on, static and shared, {although in this last case, one can reset the router to get another shared IP assignment, or even a public one}] and for making the changes done to my resolv.conf(.head/tail) be instantly applied [which may also be unnecessary, as… seemingly, could it instantly reflect changes done to it inmediately on its own, as soon as you change it or resolv.conf.head/tail?]).

    Like

  6. I have found a way to stop QT5WebKit from depending on DBus. QT5WebKit only depends on DBus if QTWidgets is compiled with GTK support. If such support is disabled, QT applications will still work, but they won’t integrate with the GTK GUI. What this means is that GTK applications will be clearly noticed as different from QT applications, instead of QT ones blending into GTK’s styles, as it is common. These fixes allow for the emerging (getting from the official Portage tree and installing) of ShotCut (a popular video editor), and further, enabling the USE flags of WebKit, Widgets, WebChannel, AND disabling WebEngine, you can emerge OpenShot (another popular video editor).
    These changes would break another applications which would require the WebEngine USE flag applied to the respective packages. It’s like a cat and mouse game, with DBus and its ilk.

    Note that I did these changes on a local level (by specifying the USE variable on the command itself, as so: USE=”$USE qt5 webkit widgets webchannel -dbus -gtk -webengine” emerge -p openshot: note that ffmpeg needs the vpx flag, and zeromq, drafts, but these are far easier when compared to the DBus mess) as a sort of quick test. You may have to be far more specific to avoid being too sweeping with these flags.

    I have noticed that a fully DBus-less FireFox refuses to load any session normally, and the MySessions plugin (IMO, a suitable replacement for the legendary SessionManager, that was on pre-WebExtensions [before FireFox 57]) fails to even register any session, although tabs are properly favourited (a workaround, because of the limitations of the WebExtensions API, differing from XUL, which was remarkably more free). This is solved for me, as in the past I managed to have +2000 tabs sessions, but now I barely reach to 40, often hovering around 10, and am content with that. Sometimes I keep all my tabs for the current session in Incognito.

    However, it’s important to remark that the manual “Restore Session” button works and has worked admirably in these cases.

    Like

  7. Today was kind of suprise after updating portage tree to see old ebuild of Firefox 52.x removed to be replaced by the 52.9.0 which have removed the gtk+2 support (replaced by gtk+3, leading to other hard dependencies craps like dbus…)

    I still have the 52.8.0 installed, the >= 52.9.0 is now masked, the thing for torbrowser.

    As far as I can see, the only future possible for my dbus / udev / systemd / glibc less is to get ride for good of GTK. Except the browser (firefox / tbb), nothing else use GTK.

    Using palemoon or other app dbus dep in a virtual qemu linux img is the only thing that come trought my mind. Removing the support of dbus of the app that depend on dbus ins’t a great idea : bug / functionnality not working… is what will always happen (I tried this for a while)

    Fluxbox is a great wm, rxvt-unicode a great term, xfe offer a nice graphical file manager, text editor, image viewer… I’m sure you can replace most if it’s not all your gtk / dbus app by something similiar or better that doesn’t require to infect your OS.

    Like

  8. DbusDie, if you’re in Gentoo, you can add the mv overlay, which has a patched GTK that has the compile time option to remove ATK-SPI2-bla, between others (something that was actually upstreamed by GNOME for a single update, but reverted in the next!), thus also killing the dependency on DBus, etc.

    Curiously, the update 60 of TBB brought back the gtk2 compile time USE flag.

    Like

  9. This just make my day, I haven’t imagined for a second such of overlay could exist, thanks a lot !

    I have layman -a mv few minutes ago, will emerge gtk+3 without dbus , can’t realise I missed this awesome overlay

    Like

  10. Ah! The update to Firefox 62 has fixed the broken session management. Take that, DBus! You are unnecessary for that!

    Like

  11. A status update: two more programs have been gotten working, winetricks and nvidia-settings.

    For the first case, it’s actually curious. Winetricks itself is a bash script. That means that you download its source, run the file manually, and it works almost perfectly. It depended on the DBus stack because of xdg-open (according to the Winetricks help information located at the top of the file itself, the “open” program is used in macOS instead), which “”allows for the opening of web pages when they are called by the programs, etc…”” (for example, when an emulated Win32 program crashes and you want to send the information to Microsoft [for some reason…]). This is far less important than it sounds. Mostly, in my experience, it is used to open “Thank you for installing our program”, and “Would you like to send a crash log?” web pages. It is only necessary when Winetricks is “installed”.

    For the second case, I was surprised because the source was available under the GPL2, and then cloned it and made it. The file “ctkgridlicense.c” gave complications. After analyzing its 1892 lines, I concluded that DBus is only menctioned ~3-4 times the whole time, the first to include it, the second to set easier function names than the raw calls, the third and fourth to load DBus symbols, initialize errors (LOL), work on verifying a GRID license, and other such miscellaneous incredibly small things (around 5 more menctions?). What is GRID, you may ask? It is a series of specific cards made to stream “cloud” games and things (they describe it as “virtualization”, however) underneath demanding conditions. Incredibly, the option, or indeed any menction of these things is fully absent from a compiled with DBus nvidia-settings. It could seem that it only appears when you have one installed/connected and it is detected.

    I wonder why NVIDIA decided to use DBus for license verification instead of a propietary, static-compiled IPC (as they do with the libjansson)? They have included DBus in ctkgridlicense.c (which is just ONE file) since the ~352-374 driver release, and have other DBus menctions in nv_grid_dbus.h, a tiny file of 60 lines which defines GRID license functions, and can be left alone when you purge DBus.

    To purge DBus from nvidia-settings, I went through the ctkgridlicense.c file, removing DBus anywhere it was. This, however, resulted in an unusable binary, as the included libnvidias demanded the presence of ctk_manage_grid_license, which I had removed fully, instead of blanking and dummying (a “{” to start the function, and, around two lines below it, a “}” to close it, with nothing inside, not even a “void” definition) it. My next attempt resulted in an unlinkable binary, as something in the top of the file regarding an inert DBus definition (I decided to let it there to avoid upsetting the libnvidias into refusing to let me run the file [these two libnvidias are fully propietary, with the source code being closed]) had confused ld. Finally, after also blanking and dummying that section carefully, the binary compiled and ran perfectly. I had to do the workaround of “-I .”, to tell the program to look for the GTK2 libraries in the directory where it was. It’s odd that it struggled to see them in my system, considering that they were installed, and the local versions were right before its nose (comparatively speaking).

    Almost everything else that was DBus related in ctkgridlicense.c was removed. nv_grid_dbus.h was left alone, as removing it would have probably resulted in a linking error or the libnvidias refusing again.

    It’s curious that NVIDIA has released the source to these things. Anybody could modify the license verification calls to make them able to accept spoofed or fake licenses.

    Some other notes: the whole project is coded in C and Makefile language, and in my examinations, I noticed that the writers only used spaces, never tabs.

    Regarding the Gentoo install file fungalnet menctioned as hopefully being developed, it’s rather simple: you can choose the desktop profile (the Gentoo handbook explains about this), and you have to specify “-pam -systemd -elogind -consolekit -polkit -dbus -udisks -upower -zeroconf -avahi” in /etc/portage/make.conf, alongside other chosen USE flags (I may have missed one or two) and your system will be built without DBus. Also, mask these packages and the rest of the cancer stack in /etc/portage/package.mask (a file that menctions the package in Gentoo’s Portage syntax, for instance: sys-apps/dbus).

    May you be well.

    Like

  12. Just get back from holiday and wanted to confirm that the ebuild of gtk+ 3.24.1 provided by the overlay mv work nicely, It is a real relief and comfort to have GTK 3 without dbus and co.

    As for now, I use GTK for Qemu (bye bye SDL2 :)), Firefox and Torbrowser, let me thank you again for your great advice.

    Speaking about the useflag, I already used those when I “builded” my Gentoo along the “minimal”, it require to spend time on a lot of ebuild (package.use for instance) but definitively worth it.

    You said right about the cancer can be dbus, if not masked, even with the appropriate useflag inside the make.conf, dbus and other ebuild (like at-spi2-*…) can find a way to get place in the system when using emerge for update all the system (emerge –world), it happened once when I was distracted and didn’t check what going to be update / install.

    dbus can always be optional, you have proved it.

    Like

  13. Hello everybody and nice to meet you.

    This is a very interesting work you have done, but I want to be honest I’m not ready to accomplish the same work on my side. So, I was looking for a DBus alternative and I found something. I’m not an expert in this area and it may not be appropriate at all, but this is what I found.

    Aeron: “Efficient reliable UDP unicast, UDP multicast, and IPC message transport” with Java and C++ clients. The github link https://github.com/real-logic/aeron and a video https://www.youtube.com/watch?v=tM4YskS94b0.

    I would be really interested to get the advice of someone with knowledge in this area and what would be the amount of work to be done, in case if Aeron is suitable as an alternative, to integrate it with ours current softwares.

    Thx

    Like

  14. Yann-kaelig, the problem with D-Bus isn’t D-Bus itself, it’s the ideology behind it. IPC is built in to the *nix workflow already with named pipes, sockets, etc. and D-Bus is simply not required to exist. “Subscribing” as you would in D-Bus can be accomplished with sockets by simply reading from it, for example.
    D-Bus also has a number of ancillary features such as automatic service registration—for example, if D-Bus is configured to start with your computer, as it is with most systemd distros, it will start any services that might be needed, such as notification daemons, print servers, etc… Things that should be done by the service manager!
    D-Bus, as systemd, does more than it really should, and solves a problem that doesn’t exist.

    Like

  15. hey, Anti-Dbus, are you still listening?
    I am trying to do the same as you have but with arch or void instead of Gentoo, as I am more familiar with them.
    I noticed that the first thing I didn’t get to work without dbus was my favorite and 2nd favorite terminal. xterm is about the only thing that works without dbus. What they need is libdbus.so,….. which they actually read, it is not like a dummy file that can replace it. I don’t know why yet, maybe because they have tabs that connect to each other through vte?
    This is a minimal installation with minimal xorg stuff, no consolekit, no cgmanager, no display manager, just xorg-xinit and openbox. The damn xterm is killing my eyes 🙂
    It looks feasible though, and it is light as hell. I am using s6 as init and 66tools from a beta iso Obarun has put out a few days ago.

    There have been tons of hits of interest in running without dbus so I thought it was worthwhile to pursue the project through arch or void.

    Send a note of an update of how it is going for you.

    Like

  16. just now, I configured my gentoo system to not have dbus, elogind/logind, eudev/udev and pam. my issue is finding a web browser that doesn’t depend on dbus. firefox, midori, seamonkey, falkon and qutebrowser all need it. what should I do? get the gtk version from the mv overlay (and.use firefox) or does that not work nowadays? maybe I need to do something with qt widgets and get qutebrowser to work? what are your suggestions? currently I am stuck without a web browser but I know there must be a way to get one.

    Like

  17. Dbus-Die,
    Recently I thought to rebel against Arch’s (Artix an Obarun included) dictated dependency called dbus, and removed it. Initially I dropped it through the service manager and didn’t allow it to run. Then I just removed it all together. With my limited use of the graphical capabilities of the system it seems that everything has been running fine without it for quite a while. I was most surprised that cups and printing worked. So now I am confused as to what dbus actually does that makes no difference to me whether it exists or not. I understand the theoretical principle of a messaging bus, but practically I have run everything as I always did without dbus. All you have to do in an arch based system is “# pacman -Rdd dbus” (dd is for not removing dependents to the package). I thought all hell will break lose but didn’t.

    Also, there is a new system called venom linux, I tried it in its first release, it is very Gentoo like. Still in need for more work but it appears promising. I wonder if you have noticed it. I will wait a little while more to see how it develops and do a full review of it.

    Like

  18. Hello guys!.
    i’m in gentoo, without systemd, busybox, atk_spi, dbus, elogind, consolekit, polkit, pam, pulseaudio, netwokmanager. avahi, zeroconf.
    I have managed to break dependencies by moving the ebuilds to my local tree and editing them …

    nano -w package.ebuild

    ebuild package.ebuild manifest

    eix-update

    eix package

    emerge -av1 package

    There is an ebuild out there to remove atk from x11-libs/gtk+:3 adding use -atk-bridge and patches to disable forced atk in the official ebuild.
    One problem I have is with libreoffice, is that it does not create the menu bar if I do not have dbus enabled … so at the moment it only
    I am using the icon bar, who knows how to solve this I will be grateful if you report it here.
    Start with startx and server x in user mode, without graphical login (before I used slim)

    It is comforting to know that many know what is happening, it is not necessary to explain much more.

    Like

If your comment is considered off-topic a new topic will be created with your comment to continue a different discussion. This community is based on open and free communication, meaning we must all respect all in minimizing the exercise of freedom to disrupt such communication. Feel free to post what you think but keep in mind the subject matter discussed. It is just as easy to start a new topic as it is to dilute the content of an existing discussion.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.