You are not logged in.

#1 2021-03-23 18:39:33

Jhackler
Member
Registered: 2014-01-27
Posts: 23

systemctl --user status (or any systemctl --user) use gives error

Anytime I try to do anything this systemctl --user status on my updated arch I get the message "Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)" I don't know what this means or how to fix it any help would be appreciated.  This is locally on my desktop I am using Gnome on Wayland.) or if anyone can point me in the right directions been searching this issue for 2 days now.

Offline

#2 2021-03-23 19:01:17

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 9,003
Website

Re: systemctl --user status (or any systemctl --user) use gives error

Does it work if you set the variables manually?

XDG_RUNTIME_DIR=/run/user/"$UID"
DBUS_SESSION_BUS_ADDRESS=unix:path="$XDG_RUNTIME_DIR"/bus
systemctl --user status

Is the login session working?

loginctl user-status

Jin, Jîyan, Azadî

Offline

#3 2021-03-23 19:53:01

Jhackler
Member
Registered: 2014-01-27
Posts: 23

Re: systemctl --user status (or any systemctl --user) use gives error

Having same error on xorg session the login ctl user status word for that manually settinging it do I put in a number at the UID or past as is?

Offline

#4 2021-03-23 19:55:56

Jhackler
Member
Registered: 2014-01-27
Posts: 23

Re: systemctl --user status (or any systemctl --user) use gives error

asking because trying the lines one by on or all together as is yielded no change

Offline

#5 2021-03-24 00:29:17

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: systemctl --user status (or any systemctl --user) use gives error

Does the directory /run/user/`id -u` exist? How do you log in to that user?  What is the output of `env`?

Offline

#6 2021-03-24 00:41:59

Jhackler
Member
Registered: 2014-01-27
Posts: 23

Re: systemctl --user status (or any systemctl --user) use gives error

am I suppose to put something in place --user ior is the command supposed to work exactly as I typed here?

"SHELL=/bin/bash
SESSION_MANAGER=local/jhackler-work:@/tmp/.ICE-unix/2859,unix/jhackler-work:/tmp/.ICE-unix/2859
WINDOWID=20971527
COLORTERM=truecolor
CSF_MDTVTexturesDirectory=/usr/share/opencascade/resources/Textures
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_MENU_PREFIX=gnome-
CSF_DrawPluginDefaults=/usr/share/opencascade/resources/DrawResources
LANGUAGE=
CSF_LANGUAGE=us
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
CSF_MIGRATION_TYPES=/usr/share/opencascade/resources/StdResource/MigrationSheet.txt
SHELL_SESSION_ID=af7e407c845949508483b7f0c4bf310a
DESKTOP_SESSION=gnome-wayland
CSF_OCCTResourcePath=/usr/share/opencascade/resources
CSF_STEPDefaults=/usr/share/opencascade/resources/XSTEPResource
EDITOR=/usr/bin/nano
PWD=/home/tag
XDG_SESSION_DESKTOP=gnome-wayland
LOGNAME=tag
QT_QPA_PLATFORMTHEME=qt5ct
XDG_SESSION_TYPE=wayland
DRAWHOME=/usr/share/opencascade/resources/DrawResources
XAUTHORITY=/run/user/1000/.mutter-Xwaylandauth.68MM00
CSF_StandardLiteDefaults=/usr/share/opencascade/resources/StdResource
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/tag
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
QT_STYLE_OVERRIDE=gtk
MOTD_SHOWN=pam
HOME=/home/tag
LANG=en_US.UTF-8
XDG_CURRENT_DESKTOP=GNOME
KONSOLE_DBUS_SERVICE=:1.134
WAYLAND_DISPLAY=wayland-0
KONSOLE_DBUS_SESSION=/Sessions/1
PROFILEHOME=
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
INVOCATION_ID=dcd4786f6668417dbf7432ae76392df0
KONSOLE_VERSION=201203
MANAGERPID=2796
CSF_ShadersDirectory=/usr/share/opencascade/resources/Shaders
CSF_EXCEPTION_PROMPT=1
CSF_XmlOcafResource=/usr/share/opencascade/resources/XmlOcafResource
GJS_DEBUG_OUTPUT=stderr
GNOME_SETUP_DISPLAY=:1
CSF_SHMessage=/usr/share/opencascade/resources/SHMessage
XDG_SESSION_CLASS=user
TERM=xterm-256color
USER=tag
COLORFGBG=15;0
CSF_StandardDefaults=/usr/share/opencascade/resources/StdResource
CSF_IGESDefaults=/usr/share/opencascade/resources/XSTEPResource
DISPLAY=:0
CSF_XCAFDefaults=/usr/share/opencascade/resources/StdResource
SHLVL=1
MOZ_ENABLE_WAYLAND=1
CSF_PluginDefaults=/usr/share/opencascade/resources/StdResource
CSF_TObjMessage=/usr/share/opencascade/resources/TObj
CASROOT=/usr
MOZ_PLUGIN_PATH=/usr/lib/mozilla/plugins
XDG_RUNTIME_DIR=/run/user/1000
JOURNAL_STREAM=8:44728
CSF_XSMessage=/usr/share/opencascade/resources/XSMessage
LC_COLLATE=en_US.UTF-8
MMGT_CLEAR=1
GTK3_MODULES=xapp-gtk3-module
XDG_DATA_DIRS=/home/tag/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
BROWSER=/usr/bin/chromium
PATH=/home/tag/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin
CSF_TObjDefaults=/usr/share/opencascade/resources/StdResource
GDMSESSION=gnome-wayland
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
HG=/usr/bin/hg
MAIL=/var/spool/mail/tag
DRAWDEFAULT=/usr/share/opencascade/resources/DrawResources/DrawDefault
QT_SELECT=qt5
GIO_LAUNCHED_DESKTOP_FILE_PID=6931
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/org.kde.konsole.desktop
KONSOLE_DBUS_WINDOW=/Windows/1
_=/usr/bin/env"

Offline

#7 2021-03-24 00:42:33

Jhackler
Member
Registered: 2014-01-27
Posts: 23

Re: systemctl --user status (or any systemctl --user) use gives error

Not sure how to attach files here I piped it to a txt file first time lol I login to the user with lightdm, I tested gdm same issue. that dbus session address might be there from the trouble shooting here I am not sure forgot to check
first lol

Last edited by Jhackler (2021-03-24 00:47:38)

Offline

#8 2021-03-24 02:44:11

loqs
Member
Registered: 2014-03-06
Posts: 18,917

Re: systemctl --user status (or any systemctl --user) use gives error

The env output contains:

XDG_RUNTIME_DIR=/run/user/1000
...
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus

Was this after you set the variables manually?

Please use code tags for commands and their outputs.

Offline

#9 2021-03-24 20:14:39

finoderi
Member
Registered: 2020-06-12
Posts: 76

Re: systemctl --user status (or any systemctl --user) use gives error

@Jhackler
Make sure you don't use 'sudo' while executing this command. It's a pretty common mistake. The command should be just

$ systemctl --user <whatever you want from it>

Offline

#10 2024-05-01 13:46:05

XoseM
Member
From: ⁂
Registered: 2013-08-17
Posts: 15
Website

Re: systemctl --user status (or any systemctl --user) use gives error

this issue is pretty old (excuse me please) but has a good title and this last reply from @finoderi pointed me in the right direction.

I was misserably failing to create a very basic systemd service for the --user (not system wide) and it was failing because there is (was) and ALIAS in ~/.bashrc.aliases like `alias systemctl='sudo systemctl'` so everytime I typed "systemctl --user ..." was prepended with "sudo", so dbus failing etc

I did not remember writing this alias, so I guess it is default on arch (or it was, as this arch is quite old)

thank you to the community and finoderi in particular

Offline

Board footer

Powered by FluxBB