[systemd-devel] comments on setting DBus addresses in pam_systemd

Mantas Mikulėnas grawity at gmail.com
Fri Jan 10 14:56:38 PST 2014


On Sat, Jan 11, 2014 at 12:20 AM, Kay Sievers <kay at vrfy.org> wrote:
> On Sat, Jan 11, 2014 at 5:59 AM, Mantas Mikulėnas <grawity at gmail.com> wrote:
>> On Fri, Jan 10, 2014 at 10:56 PM, Mantas Mikulėnas <grawity at gmail.com> wrote:
>>> (a bunch of accidental HTML)
>>
>> Thinking about this more, it could be that it was actually broken not
>> by the moved environment itself, but by my own later patches which
>> tried to make the new behavior consistent. (As Environment= was
>> removed from user at .service for both kdbus and non-kdbus cases, but
>> only added back to pam_systemd for the kdbus case, I tried to make it
>> consistent as it would have left the non-kdbus case with no
>> DBUS_SESSION_BUS_ADDRESS at all.)
>
> Yeah, I'm going to revert your patch for now, it's too early to do
> that, we only want to "break-and-fix" the --enable-kdbus case, not the
> normal one.

Thanks.

I now remembered that my "user" dbus.service/dbus.socket were taken
from Auke's repo and not from dbus itself anyway, so I guess the
Environment= line in non-kdbus case should be a local customization as
well.

> Regarding the env variables, we are currently trying to get kdbus in
> the session working and I have a wild hack in:
>   /etc/X11/xinit/xinitrc.d/00-start-message-bus.sh
>
> to export all the current variables to the systemd --user instance:
>   for i in $(compgen -e); do
>           systemctl --user set-environment $i=$(eval echo \$$i)
>   done
>
> Kay

`compgen` requires bash, in which case "$i=${!i}" would be easier and
safer… but a sh-compatible way to do it all at once is:

    xargs -0 systemctl --user set-environment < /proc/$$/environ

I guess I'll add this to my /etc/gdm/Xsession below the existing
"source ~/.profile" lines.

-- 
Mantas Mikulėnas <grawity at gmail.com>


More information about the systemd-devel mailing list