systemctl –user: Process org.freedesktop.systemd1 exited with status 1

Gang Liang asked:

The box is a debian stable (stretch as of now). The problem I encountered is that systemctl can’t query user service manager. For command,

systemctl --user

The error message is:

Failed to list units: Process org.freedesktop.systemd1 exited with status 1

For command

systemctl --user status

The error message is:

Failed to read server status: Input/output error

On the other hand, everything looks fine that there is no failed service, and user@1000.service is working as expected. Basically, all user units are running normally, yet I can’t interact with them through the systemctl interface.

Many people had similar symptoms yet all with different issues. Tried to reboot the machine but it didn’t help.

My question is: how should I debug the user systemctl session? The information above is too generic to pinpoint the actual problem.

Thanks in advance.

My answer:

Please check the environment variable XDG_RUNTIME_DIR is defined and is equal to /run/user/$(id -u). If it is not, then define it as such and try again.

export XDG_RUNTIME_DIR=/run/user/$(id -u)

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.