TransWikia.com

xinitrc - set DBUS_SESSION_BUS_ADDRESS

Unix & Linux Asked by laur on November 28, 2021

Not using display manager and executing startup logic via xinitrc.
Problem is some dbus-related env variables are not set.

xinitrc excerpt:

dbus-update-activation-environment --systemd --all  # note this errors
/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1 &

eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh)
export GNOME_KEYRING_CONTROL GNOME_KEYRING_PID GPG_AGENT_INFO SSH_AUTH_SOCK DBUS_SESSION_BUS_ADDRESS DBUS_SESSION_BUS_PID

First one returns error

dbus-update-activation-environment: warning: error sending to systemd: org.freedesktop.DBus.Error.InvalidArgs: Invalid environment assignments

How to make sure dbus vars (eg DBUS_SESSION_BUS_ADDRESS) are set?

Note alternatively I could comment out these lines from /usr/bin/startx:

unset DBUS_SESSION_BUS_ADDRESS
unset SESSION_MANAGER

but not sure that’s the way to go.

Running debian testing.

One Answer

I use startx just fine (Debian unstable + experimental). If you look at where the dbus environment variables are set (again), it's in /etc/X11/Xsession.d/20dbus_xdg-runtime. I use my own .xinitrc, and I realized a bunch of problems I had stemmed from not sourcing the scripts in /etc/X11/Xsession.d (as the default xinitrc does). Instead of trying to run dbus-update-activation-environment yourself, I would strongly recommend you source the files in /etc/X11/Xsession.d instead (they add a bunch of other things like modifying your xhost settings).

Answered by Chiraag on November 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP