[systemd-devel] [systemd-commits] units/user at .service.in

Lennart Poettering lennart at poettering.net
Mon Mar 25 09:54:16 PDT 2013


On Fri, 22.03.13 21:46, Auke-Jan Kok (auke at kemper.freedesktop.org) wrote:

>  units/user at .service.in |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> New commits:
> commit 3abcb6acedb588ca17f6374c1836f8a58396e520
> Author: Auke Kok <auke-jan.h.kok at intel.com>
> Date:   Fri Mar 22 21:43:31 2013 -0700
> 
>     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

Hmm, with the old %I wouldn't it suffice to instantiate the unit via
user at USERNAME.service rather than user at UID.service?

I mean, I am not against this patch, just noticing this...

> 
> diff --git a/units/user at .service.in b/units/user at .service.in
> index 2c15495..901a334 100644
> --- a/units/user at .service.in
> +++ b/units/user at .service.in
> @@ -6,14 +6,18 @@
>  #  (at your option) any later version.
>  
>  [Unit]
> -Description=User Manager for %I
> +Description=User Manager for %u
>  After=systemd-user-sessions.service
>  
>  [Service]
>  User=%I
>  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
>  Type=notify
>  ExecStart=- at 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
> 
> _______________________________________________
> systemd-commits mailing list
> systemd-commits at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-commits


Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list