Bug 68164

Summary: systemd-206: user sessions require /etc/pam.d/systemd-shared
Product: systemd Reporter: Ivan Shapovalov <intelfx100>
Component: generalAssignee: systemd-bugs
Status: RESOLVED FIXED QA Contact: systemd-bugs
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: All   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: Log for systemd --user's PID (initially).
Log for systemd --user's PID (after symlinking the PAM config).

Description Ivan Shapovalov 2013-08-15 23:31:59 UTC
When a "systemd --user" instance is spawned by user@.service, it gets /run as its runtime directory (i. e. %t inside of units resolves to /run) instead of /run/user/$UID, as it was with v204.
Comment 1 Zbigniew Jedrzejewski-Szmek 2013-08-27 05:20:36 UTC
Hm, I can't confirm this. I tried:

[Service]
ExecStart=/usr/bin/sleep 100
Environment=TDIR=%t

and /proc/<pid>/environ contains
TDIR=/run/user/1005
as expected.

Can you show where exactly are you getting %t pointing to /run?
Comment 2 Ivan Shapovalov 2013-08-27 14:54:30 UTC
Here it is.

I've tried a simple unit (linked to default.target.wants):

[Unit]
Description=Unit that shows XDG_RUNTIME_DIR=%t

[Service]
Type=oneshot
ExecStart=/bin/false

In logs it appeared as "Unit that shows XDG_RUNTIME_DIR=/run". I'll attach logs shortly.

And here is a bit of research. I found that there is no /etc/pam.d/systemd-shared, although it is mentioned in user@.service (PAMName=systemd-shared). I've tried symlinking system-login -> systemd-shared, and that solved (well... worked around) the bug.
Comment 3 Ivan Shapovalov 2013-08-27 14:55:37 UTC
Created attachment 84716 [details]
Log for systemd --user's PID (initially).
Comment 4 Ivan Shapovalov 2013-08-27 14:56:53 UTC
Created attachment 84717 [details]
Log for systemd --user's PID (after symlinking the PAM config).
Comment 5 Zbigniew Jedrzejewski-Szmek 2013-09-09 19:22:50 UTC
It is confusing and annoying that systemd throws errors and doesn't work properly without a configuration file. Even though user sessions are not ready for general consumption, we should not be shipping with a configuration that
throws errors by default. To some extent this is a distribution problem, since PAM setup varies widely, but hopefully we can find something that works most of the time.
Comment 6 Zbigniew Jedrzejewski-Szmek 2013-09-11 20:38:25 UTC
Should now work with http://cgit.freedesktop.org/systemd/systemd/commit/?id=5c390a4.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.