Zrok-agent on raspberry pi 3

I'm trying to follow the instructions on Linux Agent Service | zrok but it doesn't work.

pi@homebridge:/etc/systemd/system $ sudo apt install zrok-agent
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
zrok-agent is already the newest version (1.0.6-1).
0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
pi@homebridge:/etc/systemd/system $ systemctl --user enable --now zrok-agent.service
Failed to connect to bus: No medium found

Are any user services enabled? The unfamiliar error causes me to wonder if something is preventing systemd from managing processes entirely.

systemctl --user list-unit-files --state=enabled

Will it allow you to enable without --now?

pi@homebridge:/var/lib/homebridge $ systemctl --user list-unit-files --state=enabled
Failed to connect to bus: No medium found

I was able to trigger the same error with Debian 12 by running systemctl --user while my user did not have a D-Bus session.

I suspect that you're using the common distribution for Raspberry Pi, Raspbian, and that it is not configured to provision a D-Bus session for the pi user.

This demonstrates the different outcomes depending on whether the shell is invoked as a login session.

❯ lxc shell debian-test -- systemctl --user status dbus.socket
Failed to connect to bus: No medium found

❯ lxc shell debian-test <<< "systemctl --user status dbus.socket"
● dbus.socket - D-Bus User Message Bus Socket
     Loaded: loaded (/usr/lib/systemd/user/dbus.socket; static)
     Active: active (listening) since Mon 2025-06-23 13:03:18 UTC; 11ms ago
   Triggers: ● dbus.service
     Listen: /run/user/0/bus (Stream)
    Process: 254 ExecStartPost=/bin/systemctl --user set-environment DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/0/bus (code=exited, status=0/SUCCESS)
      Tasks: 0 (limit: 112954)
     Memory: 20.0K
        CPU: 3ms
     CGroup: /user.slice/user-0.slice/user@0.service/app.slice/dbus.socket

Jun 23 13:03:18 debian-test systemd[248]: Starting dbus.socket - D-Bus User Message Bus Socket...
Jun 23 13:03:18 debian-test systemd[248]: Listening on dbus.socket - D-Bus User Message Bus Socket.

You can perform the same test to confirm the foundational problem is an unavailable D-Bus socket for your logged in user.

systemctl --user status dbus.socket

And, you can confirm the system-wide D-Bus socket is available. Please respond back to confirm this command works. That will tell me if Raspbian users could run the forthcoming zrok-agent system-wide, privileged service instead of the user service, without any additional configuration.

systemctl status dbus.socket

Normally, the user session is created when you log in via PAM, either a desktop session like gnome-session or via SSH's UsePAM. I'm guessing you're logging in with SSH, so let's first verify that the OpenSSH server is enabled for PAM.

grep -i 'UsePAM' /etc/ssh/sshd_config

And, ensure these packages are installed.

dpkg -l libpam-systemd dbus-user-session

I don't have a RasPi handy to check this out directly, but it's clear the problem is that the pi user doesn't have a "login session," and I suspect this is the default for some distributions like Raspbian.

If that doesn't get you headed in the right direction, please also share the distribution version you're running on your RasPi, and the output of these commands.

loginctl show-user pi
loginctl show-users     
loginctl list-users
loginctl list-sessions