DBUS-UPDATE-ACTIVA(1)
๐ DBUS-UPDATE-ACTIVA(1) โ like, the User Commands manual, bestie
Okay so picture this: a manual page from the User Commands section, and it's all about dbus-update-activation-environment. Yes that's a whole mouthful. Yes I'm obsessed. Let's get into it ๐ซถ
โจ NAME โจ
dbus-update-activation-environment โ update environment used for D-Bus session services
๐ธ SYNOPSIS ๐ธ
dbus-update-activation-environment [--systemd] [--verbose] --all |
VAR... | VAR=VAL...
Like, you literally pick one of three vibes at the end there: --all, or a bunch of VARs, or a bunch of VAR=VALs. Choose your fighter ๐
๐ฆ DESCRIPTION ๐ฆ
dbus-update-activation-environment updates the list of environment variables used by dbus-daemon --session when it activates session services without using systemd. That's the whole gig, no cap.
With the --systemd option, if an instance of systemd --user is available on D-Bus, it also updates the list of environment variables used by systemd --user when it activates user services โ including D-Bus session services for which dbus-daemon has been configured to delegate activation to systemd. It's very similar to the import-environment command provided by systemctl(1). Very demure, very mindful, very same-energy โจ
Variables that are special to dbus-daemon or systemd may be set, but their values will be overridden when a service is started. So like, for instance, it is not useful to add DBUS_SESSION_BUS_ADDRESS to dbus-daemon's activation environment, although it might still be useful to add it to systemd's activation environment. The tea: dbus-daemon will just steamroll over it ๐ญ
Not me reading that twice โ it's giving "you can do it, but why would you." Still, the systemd side is lowkey a different story ๐
๐ OPTIONS ๐
--allโ Set all environment variables present in the environment used bydbus-update-activation-environment. Literally all of them, main character energy for every single var ๐--systemdโ Set environment variables for systemd user services as well as for traditional D-Bus session services. Both worlds, bestie ๐ซถ--verboseโ Output messages to standard error explaining whatdbus-update-activation-environmentis doing. It's narrating its own life, iconic ๐VARโ IfVARis present in the environment ofdbus-update-activation-environment, set it to the same value for D-Bus services. Its value must be UTF-8 (if not, it is skipped with a warning). IfVARis not present in the environment, this argument is silently ignored. Silent treatment fr fr ๐VAR=VALโ SetVARtoVAL, which must be UTF-8. Straight to the point, periodt โญ
๐ EXAMPLES ๐
dbus-update-activation-environment is primarily designed to be used in Linux distributions' X11 session startup scripts, in conjunction with the "user bus" design.
To propagate DISPLAY and XAUTHORITY to dbus-daemon and, if present, systemd, and propagate DBUS_SESSION_BUS_ADDRESS to systemd:
dbus-update-activation-environment --systemd \
DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY
To propagate all environment variables except XDG_SEAT, XDG_SESSION_ID and XDG_VTNR to dbus-daemon (and, if present, systemd) for compatibility with legacy X11 session startup scripts:
# in a subshell so the variables remain set in the
# parent script
(
unset XDG_SEAT
unset XDG_SESSION_ID
unset XDG_VTNR
dbus-update-activation-environment --systemd --all
)
The subshell thing is so important โ the comment literally says why. Read the comment, bestie ๐ญ
๐ฅ EXIT STATUS ๐ฅ
dbus-update-activation-environment exits with status 0 on success, EX_USAGE (64) on invalid command-line options, EX_OSERR (71) if unable to connect to the session bus, or EX_UNAVAILABLE (69) if unable to set the environment variables. Other nonzero exit codes might be added in future versions. So like, don't hardcode your guesses, okay? ๐ฆ
๐ ENVIRONMENT ๐
DBUS_SESSION_BUS_ADDRESS, XDG_RUNTIME_DIR and/or DISPLAY are used to find the address of the session bus. Those three are the little search party ๐
๐ LIMITATIONS ๐
dbus-daemon does not provide a way to unset environment variables after they have been set (although systemd does), so dbus-update-activation-environment does not offer this functionality either. Once it's set, it's set โ no take-backs, no undo button ๐
POSIX does not specify the encoding of non-ASCII environment variable names or values and allows them to contain any non-zero byte, but neither dbus-daemon nor systemd supports environment variables with non-UTF-8 names or values. Accordingly, dbus-update-activation-environment assumes that any name or value that appears to be valid UTF-8 is intended to be UTF-8, and ignores other names or values with a warning. It's UTF-8 or it's nothing, and it will tell you about it ๐
๐ BUGS ๐
Please send bug reports to the D-Bus bug tracker or mailing list. See https://www.freedesktop.org/wiki/Software/dbus/. Please do โ they're literally asking nicely ๐ซถ
๐ AUTHOR ๐
See https://dbus.freedesktop.org/doc/AUTHORS โ the whole crew is over there ๐
๐ง SEE ALSO ๐ง
dbus-daemon(1), systemd(1), the import-environment command of systemctl(1)
๐ COPYRIGHT ๐
Copyright ยฉ 2015 Collabora Ltd.
This man page is distributed under the same terms as dbus-update-activation-environment (MIT/X11). There is NO WARRANTY, to the extent permitted by law.
And that's the whole page, bestie โ ily, go forth and activate your environment ๐โจ Shoutout to D-Bus 1.16.2, dated 03/03/2025, for being the source/version + date of this whole masterpiece. Mwah ๐
๐ฆ where this page comes from
- alpine 3.22: dbus-doc 1.16.2-r1 ยท AFL-2.1 OR GPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms