Bug#814670: login: su - clears XDG_RUNTIME_DIR

2016-04-22 Thread Vivek Das Mohapatra

On Fri, 22 Apr 2016, Vivek Das Mohapatra wrote:


The problem is that libpam_systemd.so (which normally sets up the XDG_*


By which of course I mean pam_systemd.so

Bug#814670: login: su - clears XDG_RUNTIME_DIR

2016-04-22 Thread Vivek Das Mohapatra
The problem is that libpam_systemd.so (which normally sets up the XDG_* 
variables, I think) is detecting a pre-existing audit session and bailing

out.

Background:

  https://github.com/systemd/systemd/issues/825
  https://lists.freedesktop.org/archives/systemd-devel/2015-January/027711.html

I'm looking into a possible fix to make su - and similar work properly again
in this scenario, if you'd be interested in testing it (although obviously
don't just take my word for it and install random libpam components from 
strangers on the internet - I'd advise you to use a throwaway VM).


I don't have an ETA yet, just started digging into the problem,
but I thouhgt I'd post and let you know it was being looked at.



Bug#814670: login: su - clears XDG_RUNTIME_DIR

2016-02-13 Thread Rafael Cunha de Almeida
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  libpam0g1.1.8-3.1+deb8u1

login recommends no packages.

login suggests no packages.

-- no debconf information