You are not logged in.

#1 2021-01-11 00:03:14

nuclear-gnocchi
Member
Registered: 2021-01-10
Posts: 3

[SOLVED] Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS

I recently installed Redshift and I'm trying to get it to auto start when I log in. However, I get a weird error message whenever I try to start or enable the systemd service:

$ sudo systemctl --user enable redshift.service
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined
$ sudo systemctl --user start redshift.service
Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined

When I try to start Redshift from bash, it works normally:

$ redshift
Trying location provider `geoclue2'...
Using provider `geoclue2'.
Using method `randr'.
Waiting for initial location to become available...
Location: XXX.XX N, XXX.XX W

(Location censored for obvious reasons)
I do not know what $DBUS_SESSION_BUS_ADDRESS or $XDG_RUNTIME_DIR are, I do not know where they would be located, and I do not know how I could even start to fix this. I looked online and found something about not being able to connect to a bus, but I couldn't find any information on what that meant. I've already tried reinstalling Redshift multiple times, but nothing changes when I do.
How can I fix this? Do I just have to make new files somewhere? Do I have to reinstall something?

Last edited by nuclear-gnocchi (2021-01-11 17:00:35)

Offline

#2 2021-01-11 00:21:10

loqs
Member
Registered: 2014-03-06
Posts: 17,304

Re: [SOLVED] Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS

I would suggest starting by reading General_troubleshooting#Session_permissions.
Additionally how do you login?  What is the output of the following

systemctl status --system
systemctl status --user
env

Offline

#3 2021-01-11 00:28:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS

nuclear-gnocchi wrote:

$ sudo systemctl --user enable redshift.service

You don't elevate privileges to start your user services.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2021-01-11 00:38:26

nuclear-gnocchi
Member
Registered: 2021-01-10
Posts: 3

Re: [SOLVED] Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS

jasonwryan wrote:
nuclear-gnocchi wrote:

$ sudo systemctl --user enable redshift.service

You don't elevate privileges to start your user services.

Oh, whoops. I got it working with

$systemctl --user enable redshift.service

Thanks big_smile

Offline

#5 2021-01-11 13:51:11

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: [SOLVED] Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS

Please remember to mark your thread [SOLVED] (edit the title of your first post).


How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.

Offline

#6 2021-01-11 17:01:22

nuclear-gnocchi
Member
Registered: 2021-01-10
Posts: 3

Re: [SOLVED] Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS

2ManyDogs wrote:

Please remember to mark your thread [SOLVED] (edit the title of your first post).

Whoops, thank you!

Offline

#7 2021-12-15 08:01:35

grootofficial
Member
Registered: 2021-02-13
Posts: 1

Re: [SOLVED] Failed to connect to bus: $DBUS_SESSION_BUS_ADDRESS

Thanks, I was trying to enable greenclip.service as a user, and archwiki mentioned enabling it with sudo privileges as,

# systemctl --user enable greenclip.service

which is not the case, it should be executed as a normal user.

Offline

Board footer

Powered by FluxBB