From: Mateusz Moscicki Date: Fri, 19 Apr 2019 11:51:42 +0000 (+0200) Subject: tizen: Add additional unit for "unified" user session X-Git-Tag: accepted/tizen/unified/20190508.111037~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F96%2F204796%2F2;p=platform%2Fcore%2Fuifw%2Flibtbm.git tizen: Add additional unit for "unified" user session The unified user session is about moving user session units, managed by systemd --user, to main systemd, where it's managed as part of newly created user@.target. user@.target will contain same units as previously available in user/, with same UID and environment setup. systemd instance is used for unit to be able to specify UID (inherited from user@.target). The rationale behind this work is following: * VD requirement to remove user session support * boot time optimization requirements, due to: + 'systemd --user' taking 1s its own startup that could be used for unit startup + ability to better rearrange units if these managed by one systemd instance Unit installed by this commit will not be used till user login mechanism will be changed in systemd package (via changing pam_systemd to start user@.target, rather than user@.service). Change-Id: I075f90828960e3c7586330aa6a42820d04f1971b Signed-off-by: Mateusz Moscicki --- diff --git a/packaging/libtbm.spec b/packaging/libtbm.spec index 981f06e..3235949 100644 --- a/packaging/libtbm.spec +++ b/packaging/libtbm.spec @@ -81,6 +81,10 @@ rm -rf %{buildroot} install -m 644 service/tbm-drm-auth-user.service %{buildroot}%{_unitdir_user} install -m 644 service/tbm-drm-auth-user.path %{buildroot}%{_unitdir_user} +%__mkdir_p %{buildroot}%{_unitdir} +install -m 644 service/tbm-drm-auth-user@.service %{buildroot}%{_unitdir} +install -m 644 service/tbm-drm-auth-user@.path %{buildroot}%{_unitdir} + %clean rm -rf %{buildroot} @@ -88,9 +92,13 @@ rm -rf %{buildroot} %__mkdir_p %{_unitdir_user}/basic.target.wants ln -sf ../tbm-drm-auth-user.path %{_unitdir_user}/basic.target.wants/ +%__mkdir_p %{_unitdir}/user-basic@.target.wants +ln -sf ../tbm-drm-auth-user@.path %{_unitdir}/user-basic@.target.wants/ + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig rm -f %{_unitdir_user}/basic.target.wants/tbm-drm-auth-user.path +rm -f %{_unitdir}/user-basic@.target.wants/tbm-drm-auth-user@.path %files %manifest %{name}.manifest @@ -99,6 +107,8 @@ rm -f %{_unitdir_user}/basic.target.wants/tbm-drm-auth-user.path %{_libdir}/libtbm.so.* %{_unitdir_user}/tbm-drm-auth-user.path %{_unitdir_user}/tbm-drm-auth-user.service +%{_unitdir}/tbm-drm-auth-user@.path +%{_unitdir}/tbm-drm-auth-user@.service %files devel %manifest %{name}.manifest diff --git a/service/tbm-drm-auth-user@.path b/service/tbm-drm-auth-user@.path new file mode 100644 index 0000000..fac8959 --- /dev/null +++ b/service/tbm-drm-auth-user@.path @@ -0,0 +1,8 @@ +[Unit] +PartOf=userlogin@%i.target +DefaultDependencies=no +After=systemd-logind.service +Description=Wait for tbm-drm-auth display daemon socket + +[Path] +PathExists=/run/tbm-drm-auth diff --git a/service/tbm-drm-auth-user@.service b/service/tbm-drm-auth-user@.service new file mode 100644 index 0000000..6c3d40e --- /dev/null +++ b/service/tbm-drm-auth-user@.service @@ -0,0 +1,13 @@ +[Unit] +PartOf=userlogin@%i.target +Description=Creating a link file for user to access tbm-drm-auth +DefaultDependencies=no +Before=starter@%i.service + +[Service] +User=%i +Environment=DBUS_SESSION_BUS_ADDRESS=kernel:path=/sys/fs/kdbus/%i-user/bus;unix:path=/run/user/%i/bus +Environment=XDG_RUNTIME_DIR=/run/user/%i +SmackProcessLabel=User +Type=oneshot +ExecStart=/usr/bin/sh -c "while [ ! -e /run/tbm-drm-auth ] ; do /usr/bin/sleep .1 ; done ;/usr/bin/ln -s /run/tbm-drm-auth /run/user/%i/"