У пн, 2024-08-26 у 10:27 +0200, Nils Landt пише: > > Roman Riabenko via hat am 25.08.2024 13:08 CEST > > geschrieben: > > > > How to expose service files to D-Bus on a foreign distribution? > > I'm 100% guessing here, but I think systemd just doesn't see your > service files because they are not in the search path. > If this is the case, you can set XDG_DATA_DIRS in > ~/.config/systemd/user.conf (under the Manager header), i.e.: > [Manager] > ManagerEnvironment="XDG_DATA_DIRS=/home/purism/.guix-profile/share" Thank you for the suggestion. The lines are already present. I assume that the guix installation script added them. $ cat ~/.config/systemd/user.conf [Manager] ManagerEnvironment="XDG_DATA_DIRS=/home/purism/.guix-profile/share" It may be working because the systemd environment for the user session gets the value. $ systemctl --user show-environment | grep XDG_DATA_DIRS XDG_DATA_DIRS=/home/purism/.guix-profile/share:/home/purism/.guix- profile/share:/usr/share/librem5:/home/purism/.guix- profile/share:/home/purism/.guix- profile/share:/usr/share/librem5:/home/purism/.local/share/flatpak/expo rts/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/ But systemd does not pass the value to the user DBus environment. $ systemctl --user status dbus | grep PID Main PID: 1261 (dbus-daemon) $ sudo strings /proc/1261/environ | grep XDG_DATA_DIRS XDG_DATA_DIRS=/home/purism/.local/share/flatpak/exports/share:/var/lib/ flatpak/exports/share:/usr/local/share/:/usr/share/ So, DBus does not see the service files in the guix profile. $ LC_ALL=C gdbus call --session --method org.freedesktop.DBus.Introspectable.Introspect --dest org.gnome.TextEditor --object-path=/org/gnome/TextEditor Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.TextEditor was not provided by any .service files The manual page for systemd-system.conf says that to set manager environment variables passed to all executed process, one can set DefaultEnvironment option. I set it as suggested in https://unix.stackexchange.com/a/698459/423679 $ cat ~/.config/systemd/user.conf [Manager] ManagerEnvironment="XDG_DATA_DIRS=/home/purism/.guix-profile/share" DefaultEnvironment="XDG_DATA_DIRS=/home/purism/.guix-profile/share" This change was ignored. So, I tried adding it to the file specified in the manual page. $ cat /etc/systemd/user.conf | grep DefaultEnvironment DefaultEnvironment="XDG_DATA_DIRS=%h/.guix-profile/share" But I could not login with that. I do not know how to investigate it further. Any suggestions are appreciated. However, it appears that the problem comes entirely from how DBus environment was configured in the host distribution. So, I will proceed looking for help there. Roman