![]() user ~ $ echo $XDG_RUNTIME_DIR $UIDįailed to connect to bus: Permission deniedīecause $XDG_RUNTIME_DIR isn't changed, systemd is trying to connect to the user runtime of your original user which my-host doesn't have permissions for. If it's with su, I found that /run/user/$UID isn't created and XDG_RUNTIME_DIR isn't updated. We chose this approach because the answers below did not resolve the problem. service file so that the service will run as the specified user and not as root or sudo. What else can we do to resolve this problem?ĪNSWER: We decided to continue running systemctl as sudo and instead to just specify the user in the. │ └─3274 /sbin/agetty -noclear tty1 linux │ └─3034 /sbin/dhclient -6 -nw -lf /var/lib/dhclient/dhclient6-eth0.lease -pf /var/run/dhclient6-eth0.pid eth0 │ ├─2919 /sbin/dhclient -q -lf /var/lib/dhclient/dhclient-eth0.lease -pf /var/run/dhclient-eth0.pid eth0 │ └─1931 /usr/lib/systemd/systemd-journald ├─1 /usr/lib/systemd/systemd -switched-root -system -deserialize 22 To confirm the state of systemctl, we then also did the following, which reported one degraded service as follows: password for ~]$ sudo systemctl start -u ssh-login-user`įailed to start Unit not ~]$ sudo -u ssh-login-user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/`id -u ssh-login-user`/bus systemctl -userįailed to get D-Bus connection: No such file or directory run/user/1001 ~]$ systemctl -user statusįailed to get D-Bus connection: No such file or ~]$ sudo install -d -o ssh-login-user /run/user/`id -u ssh-login-user` We then tried using a sudo user that has direct ssh ability from the outside world, but still got the following results: ~]$ systemctl -user daemon-reloadįailed to get D-Bus connection: No such file or ~]$ echo $XDG_RUNTIME_DIR $UID ![]() TRY AGAIN WITH DIRECT LOGIN USER PER and SUGGESTIONS: ![]() ![]() This machine has a requirement that some systemctl commands like this must not run as sudo. If the problem has to do with user privileges, what would need to be done to remediate the problem? The other postings I have found on this error message are either related to Debian with an apt-get solution that does not apply here, or are related to Docker images, which also do not apply here. What specifically needs to be done to resolve and remove this error? ~]$ systemctl -user daemon-reloadįailed to get D-Bus connection: Connection refused A sudo user named my-host is getting the following error message when trying to reload systemctl on an Amazon Linux 2 EC2 image. ![]()
0 Comments
Leave a Reply. |