mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
Update user session unit template.
While most folks will be using the derivative from user-session-units, I'm updating this one to reflect some of the fixes and things to note about user sessions: - cgroup should be set with "%u" - username instead of %I - set dbus path with %U explicitly too - hint to folks that wish to use MEM_CG features in user sessions - allow unit to be enabled for instances with systemctl enable
This commit is contained in:
parent
4589f5bb0a
commit
3abcb6aced
@ -6,14 +6,18 @@
|
|||||||
# (at your option) any later version.
|
# (at your option) any later version.
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=User Manager for %I
|
Description=User Manager for %u
|
||||||
After=systemd-user-sessions.service
|
After=systemd-user-sessions.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=%I
|
User=%I
|
||||||
PAMName=systemd-shared
|
PAMName=systemd-shared
|
||||||
ControlGroup=%R/user/%I/shared cpu:/
|
# in order to allow MEM_CG features to work, add "memory:/" here
|
||||||
|
ControlGroup=%R/user/%u/shared cpu:/
|
||||||
ControlGroupModify=yes
|
ControlGroupModify=yes
|
||||||
Type=notify
|
Type=notify
|
||||||
ExecStart=-@rootlibexecdir@/systemd --user
|
ExecStart=-@rootlibexecdir@/systemd --user
|
||||||
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/dbus/user_bus_socket
|
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/dbus/user_bus_socket
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
Alias=user@%i.service
|
||||||
|
Loading…
Reference in New Issue
Block a user