logind: add service for per-user shared systemd daemon
This commit is contained in:
parent
e6061ab2af
commit
d42d27ead9
|
@ -353,7 +353,8 @@ nodist_systemunit_DATA = \
|
||||||
units/fsck@.service \
|
units/fsck@.service \
|
||||||
units/fsck-root.service \
|
units/fsck-root.service \
|
||||||
units/quotacheck.service \
|
units/quotacheck.service \
|
||||||
units/rescue.service
|
units/rescue.service \
|
||||||
|
units/user@.service
|
||||||
|
|
||||||
if ENABLE_BINFMT
|
if ENABLE_BINFMT
|
||||||
nodist_systemunit_DATA += \
|
nodist_systemunit_DATA += \
|
||||||
|
@ -404,6 +405,7 @@ EXTRA_DIST = \
|
||||||
units/fsck@.service.in \
|
units/fsck@.service.in \
|
||||||
units/fsck-root.service.in \
|
units/fsck-root.service.in \
|
||||||
units/quotacheck.service.in \
|
units/quotacheck.service.in \
|
||||||
|
units/user@.service.in \
|
||||||
systemd.pc.in \
|
systemd.pc.in \
|
||||||
introspect.awk \
|
introspect.awk \
|
||||||
src/org.freedesktop.systemd1.policy.in \
|
src/org.freedesktop.systemd1.policy.in \
|
||||||
|
|
|
@ -361,6 +361,13 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||||
if (sd_booted() <= 0)
|
if (sd_booted() <= 0)
|
||||||
return PAM_SUCCESS;
|
return PAM_SUCCESS;
|
||||||
|
|
||||||
|
/* Make sure we don't enter a loop by talking to
|
||||||
|
* systemd-logind when it is actually waiting for the
|
||||||
|
* background to finish start-up, */
|
||||||
|
pam_get_item(handle, PAM_SERVICE, (const void**) &service);
|
||||||
|
if (streq_ptr(service, "systemd-shared"))
|
||||||
|
return PAM_SUCCESS;
|
||||||
|
|
||||||
if (parse_argv(handle,
|
if (parse_argv(handle,
|
||||||
argc, argv,
|
argc, argv,
|
||||||
&controllers, &reset_controllers,
|
&controllers, &reset_controllers,
|
||||||
|
@ -401,7 +408,6 @@ _public_ PAM_EXTERN int pam_sm_open_session(
|
||||||
uid = pw->pw_uid;
|
uid = pw->pw_uid;
|
||||||
pid = getpid();
|
pid = getpid();
|
||||||
|
|
||||||
pam_get_item(handle, PAM_SERVICE, (const void**) &service);
|
|
||||||
pam_get_item(handle, PAM_XDISPLAY, (const void**) &display);
|
pam_get_item(handle, PAM_XDISPLAY, (const void**) &display);
|
||||||
pam_get_item(handle, PAM_TTY, (const void**) &tty);
|
pam_get_item(handle, PAM_TTY, (const void**) &tty);
|
||||||
pam_get_item(handle, PAM_RUSER, (const void**) &remote_user);
|
pam_get_item(handle, PAM_RUSER, (const void**) &remote_user);
|
||||||
|
|
1
units/.gitignore
vendored
1
units/.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
|
user@.service
|
||||||
systemd-logind.service
|
systemd-logind.service
|
||||||
systemd-localed.service
|
systemd-localed.service
|
||||||
systemd-timedated.service
|
systemd-timedated.service
|
||||||
|
|
18
units/user@.service.in
Normal file
18
units/user@.service.in
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# This file is part of systemd.
|
||||||
|
#
|
||||||
|
# systemd is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=User Manager for %I
|
||||||
|
After=systemd-user-sessions.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=%I
|
||||||
|
PAMName=systemd-shared
|
||||||
|
ControlGroup=/user/%I/shared
|
||||||
|
ControlGroupModify=yes
|
||||||
|
Type=notify
|
||||||
|
ExecStart=-@rootbindir@/systemd --user
|
Loading…
Reference in a new issue