Skip to main content
74 votes
Accepted

Is it OK to change /etc/machine-id?

Although systemd-machine-id-setup and systemd-firstboot are great for systems using systemd, /etc/machine-id is not a systemd file, despite the tag. It is also used on systems that do not use systemd. ...
hvd's user avatar
  • 2,015
61 votes
Accepted

What is D-Bus practically useful for?

dbus does exactly what you said: it allows two-way communication between applications. For your specific example you mentioned terminator. From terminator's man page, we see: --new-tab If this ...
Stewart's user avatar
  • 14.1k
41 votes

What is D-Bus practically useful for?

There's already a great in-depth answer of D-Bus by @Stewart but I want to amend it with a high-level idea about the design of D-Bus. The "traditional" way of Inter Process Communication (...
ljrk's user avatar
  • 581
38 votes

Is it OK to change /etc/machine-id?

The easiest option is to delete /etc/machine-id on the cloned disk and reboot; systemd-machine-id-setup will generate a new one for you (you’ll need to run it manually if this doesn’t happen ...
Stephen Kitt's user avatar
21 votes

A list of available D-Bus services

gdbus is part of glib2 and supports Bash completions. Here is how to use it (on Fedora): bash-4.4$ source /usr/share/bash-completion/completions/gdbus bash-4.4$ gdbus call --system --dest <TAB>&...
geckos's user avatar
  • 371
20 votes
Accepted

How do I create a systemd scope for an already-existing process from the command line?

There are various command-line tools to make dbus calls; systemd comes with one called busctl. So you can call StartTransientUnit from the command line. The command The syntax is positively annoying,...
derobert's user avatar
  • 110k
20 votes
Accepted

Getting dbind-WARNING's about registering with the accessibility bus

Put this: export NO_AT_BRIDGE=1 someplace where it gets run, e.g. in /etc/environment or your ~/.bashrc / ~/.bash_profile. This workaround is suggested in this wiki page (in German) or here (in ...
einpoklum's user avatar
  • 9,637
17 votes

Find out the owner of a DBus service name

You can get the caller PID via org.freedesktop.DBus.GetConnectionUnixProcessID: qdbus org.freedesktop.DBus /org/freedesktop/DBus \ org.freedesktop.DBus.GetConnectionUnixProcessID org.freedesktop....
don_crissti's user avatar
  • 83.3k
17 votes
Accepted

How do you enable the secret-tool command (backed by gnome-keyring, libsecret and dbus) in a headless CentOS Docker container?

A year later, and I was able to revisit this. After a full day of researching and trying various things, I was finally able to figure this out. I hope this answer saves others the days of ...
Les Hazlewood's user avatar
15 votes

A list of available D-Bus services

I prefer busctl. Note that unlike other tools like qdbus and dbus-send this one defaults to the --system bus so to communicate with the session manager you have to explicitly use the --user switch. ...
jose angel gomez lopez's user avatar
14 votes

How do I fix my problem with hostnamectl command. It cannot connect to dbus

It looks like dbus package is missing. Check if dbus package is installed or not using below command: $ sudo dpkg -l | grep dbus ii dbus 1.10.26-0+deb9u1 ...
Ram's user avatar
  • 182
14 votes

What is D-Bus practically useful for?

In traditional Unix, there is usually little communication between running programs. Every program runs in a fully separate address space and only interacts with the kernel. This model is simple and ...
Simon Richter's user avatar
13 votes

How to allow non-root systemd service to use dbus for BLE operation

While technically @Mark's answer answered the question of how to tune the dbus bluetooth config file to achieve what I want, I noticed after looking in that file something I wish I'd noticed before ...
Travis Griggs's user avatar
12 votes
Accepted

"error constructing proxy..." when trying to launch gnome-terminal as root

Remember how Windows applications mainly worked back in the Win16 days before Win32 came along and did away with it: where there were hInstance and hPrevInstance, attempting to run a second instance ...
JdeBP's user avatar
  • 69.3k
10 votes
Accepted

How to allow non-root systemd service to use dbus for BLE operation

In /etc/dbus-1/system.d/bluetooth.conf, try adding this: <policy user="blePeripheral"> <allow own="org.bluez"/> <allow send_destination="org.bluez"/> <allow send_interface="...
Mark Stosberg's user avatar
9 votes
Accepted

Find out the owner of a DBus service name

The d-bus debug utility d-feet which is available as a package in many systems seems to be able to find the process id and command providing a service. For example, I ran it on a Fedora 23 xfce4 X11 ...
meuh's user avatar
  • 51.9k
9 votes
Accepted

How to prevent D-Bus from starting a (disabled) other daemon?

Welcome to Desktop Bus bus activation! It is a pain, and should be avoided. A Desktop Bus client (of some kind) is asking the Desktop Bus broker for communication with the org.freedesktop....
JdeBP's user avatar
  • 69.3k
9 votes

Run systemctl --user commands as root

systemd 248 (released March 2021) introduced support for the syntax -M username@ for specifying another user. $ sudo systemctl --user -M user1@ status myunit.service Reference: The new feature listed ...
Erik Sjölund's user avatar
9 votes

Run command every time regex is matched, reading from stdin which does not have an EOF

Use awk instead of grep - something like: dbus-monitor ... | awk '/Spotify/ { system("date -u +%Y%m%d-%H%M%S.%N >> timestamp.txt") }' (note the use of %Y%m%d instead of %Y%M%D - ...
cas's user avatar
  • 79.1k
9 votes

Run command every time regex is matched, reading from stdin which does not have an EOF

Since you have GNU utilities, you could do something like: dbus-monitor --session interface='org.freedesktop.Notifications',member='Notify' | sed -un 's/^.*string "Spotify".*$/now/p' | ...
Stéphane Chazelas's user avatar
8 votes

dbus: [system] Failed to activate service 'org.freedesktop.login1': timed out

Reboot was the only solution that worked for me. I killed the runaway dbus process and other things failed. This is what happened when i tried to reload httpd- Error getting authority: Error ...
Ryan Bishop's user avatar
8 votes
Accepted

Universal way to logout from terminal via dbus

On systemd setups you should be able to forcibly terminate a session via logind dbus interface: busctl call org.freedesktop.login1 /org/freedesktop/login1 \ org.freedesktop.login1.Manager ...
don_crissti's user avatar
  • 83.3k
8 votes

Cannot enable user service. “Failed to get D-Bus connection: Connection refused” Support

Looks like a package went missing: admin@Xroklaus:~ $ sudo apt-get install libpam-systemd And after a reboot it works again.
Folaht's user avatar
  • 1,072
8 votes

What is D-Bus practically useful for?

GNOME's accessibility API relies on it; see e.g. AT-SPI2 on FreeDesktop.org. Before D-BUS, i.e. before GNOME 3, the accessibility API relied on CORBA (Common Object Request Broker Architecture), which ...
Tsundoku's user avatar
  • 828
7 votes

The Devuan machine-id patch - solving a problem or blowing smoke?

As I understand it, the rationale is the machine-id is world-readable (for some value of “world” meaning any process on the computer, it’s not exposed by default); some people report that it’s being ...
Stephen Kitt's user avatar
6 votes

Connect with D-Bus in a network namespace

Linux network namespace ip-netns does separate the unix socket and as dbus uses it, it's then not accessible from the new namespace, we could imagine a feature that would leave access to unix socket ...
intika's user avatar
  • 14.6k
6 votes
Accepted

Disable auto-mounting in Ubuntu 16.04

One way of doing that is to write an udev rule that makes udisks2 ignore any added block devices. This can be done by dropping a file 10-myudisks2.rules in /etc/udev/rules.d with the rule: ACTION=="...
Tom Bjerck's user avatar
6 votes
Accepted

xinitrc - set DBUS_SESSION_BUS_ADDRESS

I use startx just fine (Debian unstable + experimental). If you look at where the dbus environment variables are set (again), it's in /etc/X11/Xsession.d/20dbus_xdg-runtime. I use my own .xinitrc, and ...
Chiraag's user avatar
  • 681
6 votes

Getting dbind-WARNING's about registering with the accessibility bus

Glad you've figured out an answer yourself; here's some more context to answer the "why" in comments. I've got this error in a setup like so. Using 2 laptops (one with Kubuntu for work, ...
ulidtko's user avatar
  • 1,048
6 votes
Accepted

Setup docker container to communicate with host over d-bus

I've found a solution. Here's my Dockerfile: FROM i386/ubuntu:16.04 RUN apt-get update RUN apt-get upgrade -y RUN apt-get install -y dbus COPY dbus.conf /etc/dbus-1/session.d/ ENTRYPOINT ["dbus-...
Milan's user avatar
  • 323

Only top scored, non community-wiki answers of a minimum length are eligible