Your message dated Sun, 12 Aug 2018 06:10:22 +0200
with message-id <20180812041022.3uaqredribk53...@fatal.se>
and subject line Re: Possible fix for su - / su -l and XDG_RUNTIME_DIR
has caused the Debian Bug report #814670,
regarding login: su - clears XDG_RUNTIME_DIR
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
814670: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814670
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: login
Version: 1:4.2-3+deb8u1
Severity: normal

Dear Maintainer,

I have an user which has daemons enabled using systemd --user. If I
login with ssh, then all works well. However, if I try using

    su - contos

to login as the user. Then systemctl fails, like so:

    $ systemctl status --user contos
    Failed to get D-Bus connection: Connection refused

Upon further investigation I found out that systemctl expects the
variable XDG_RUNTIME_DIR to be set. In this particular case, we need it
set to /run/user/1029.

    $ XDG_RUNTIME_DIR=/run/user/1029 systemctl status --user contos
    ● contos.service - blog canto de contos
    (.. normal output ..)

If I use su contos (no -), then XDG_RUNTIME_DIR is kept the same as the
previous user (which is also no good).

Since this is set correctly when using ssh but not su, I'm supposing
this is a su bug. However, I admit I do not have a full understanding on
what's going on when you su or ssh to an user.

I also tried to use

    sudo login contos

with the same effect. So, as far as I know, using ssh to login with the
user is the only reliable way to work with user's systemctl.

Please, if it is impossible to fix this behavior in jessie, would you at
least give me a reasonable workaround on how to login as a different
user without the need of ssh?

Cheers,
Rafael

-- System Information:
Debian Release: 8.3
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-x86_64-linode63 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages login depends on:
ii  libaudit1       1:2.4-1+b1
ii  libc6           2.19-18+deb8u2
ii  libpam-modules  1.1.8-3.1+deb8u1
ii  libpam-runtime  1.1.8-3.1+deb8u1
ii  libpam0g        1.1.8-3.1+deb8u1

login recommends no packages.

login suggests no packages.

-- no debconf information

--- End Message ---
--- Begin Message ---
Version: 2.32-0.3

Hello,

On Sun, May 01, 2016 at 08:29:10PM +0100, Vivek Das Mohapatra wrote:
> The attached patch adds a pam profile for su -l (and su -),
[...]

As far as I can see, the suggested patch basically implements what
has been done from the start of util-linux shipping su, so I'm thus
closing this issue. (Possibly the bug should be reassigned back
to shadow and closed on the version that no longer ships su, but
whatever...)

Regards,
Andreas Henriksson

--- End Message ---

Reply via email to