1

I am running Debian 9.4. hostname works.

$ sudo strace -f hostnamectl
...snipped...
connect(3, {sa_family=AF_UNIX, sun_path="/var/run/dbus/system_bus_socket"}, 33) = -1 ENOENT (No such file or directory)
...

Failed to create bus connection: No such file or directory

UPDATE: here are more information:

$ sudo systemctl status dbus.service dbus.socket
Unit dbus.service could not be found.
Unit dbus.socket could not be found.

$ ps -p 1 
PID TTY          TIME CMD
1   ?        00:00:47 systemd

$ sudo systemctl list-unit-files --state=running
0 unit files listed.

$ sudo systemctl list-unit-files --state=enabled
...snipped...
26 unit files listed.
  • Have you tried restarting dbus – Rui F Ribeiro Sep 7 '18 at 20:37
  • 2
    What does sudo systemctl status dbus.service dbus.socket show? – sourcejedi Sep 7 '18 at 20:38
0

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                        amd64        simple interprocess messaging system (daemon and utilities)
ii  libdbus-1-3:amd64              1.10.26-0+deb9u1                        amd64        simple interprocess messaging system (library)

If dbus package is installed you will get output as above.

If output is blank then dbus package is missing. You can install the package using below command:

$ sudo apt-get install dbus

After installing the package you can check the status:

$ sudo systemctl status dbus.service dbus.socket
● dbus.service - D-Bus System Message Bus
   Loaded: loaded (/lib/systemd/system/dbus.service; static; vendor preset: enabled)
   Active: active (running) since Fri 2018-09-07 23:39:14 EDT; 10s ago
     Docs: man:dbus-daemon(1)
 Main PID: 451 (dbus-daemon)
    Tasks: 1 (limit: 4915)
   CGroup: /system.slice/dbus.service
           └─451 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation

● dbus.socket - D-Bus System Message Bus Socket
   Loaded: loaded (/lib/systemd/system/dbus.socket; static; vendor preset: enabled)
   Active: active (running) since Fri 2018-09-07 23:39:14 EDT; 10s ago
   Listen: /var/run/dbus/system_bus_socket (Stream)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.