summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>2019-04-19 15:28:29 +0200
committerINSUN PYO <insun.pyo@samsung.com>2019-05-09 14:00:56 +0900
commit99515ebe8cbc4752ac29c0c69c074ffad29c67ee (patch)
tree89eb6902298dd3a4938db18e9d5119bce6389fba
parent777fe78d322c6ad0e0662005adf8a3c11ff04499 (diff)
downloadsystem-plugin-99515ebe8cbc4752ac29c0c69c074ffad29c67ee.tar.gz
system-plugin-99515ebe8cbc4752ac29c0c69c074ffad29c67ee.tar.bz2
system-plugin-99515ebe8cbc4752ac29c0c69c074ffad29c67ee.zip
tizen: Add additional unit for "unified" user sessionsubmit/tizen/20190509.015828accepted/tizen/unified/20190510.111115
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: I54010b3755addfe7913b5256afb2b8424c155be5
-rw-r--r--packaging/system-plugin.spec6
-rw-r--r--units/session-bind@.service16
2 files changed, 22 insertions, 0 deletions
diff --git a/packaging/system-plugin.spec b/packaging/system-plugin.spec
index b076f2d..96cae2c 100644
--- a/packaging/system-plugin.spec
+++ b/packaging/system-plugin.spec
@@ -231,6 +231,10 @@ mkdir -p %{buildroot}%{_userunitdir}/basic.target.wants
install -m 644 units/session-bind.service %{buildroot}%{_userunitdir}
ln -s ../session-bind.service %{buildroot}%{_userunitdir}/basic.target.wants/session-bind.service
+mkdir -p %{buildroot}%{_unitdir}/user-basic@.target.wants
+install -m 644 units/session-bind@.service %{buildroot}%{_unitdir}
+ln -s ../session-bind@.service %{buildroot}%{_unitdir}/user-basic@.target.wants/session-bind@.service
+
%clean
rm -rf %{buildroot}
@@ -332,6 +336,8 @@ rm -f %{_sbindir}/e4crypt
%{_bindir}/session-bind
%{_userunitdir}/session-bind.service
%{_userunitdir}/basic.target.wants/session-bind.service
+%{_unitdir}/session-bind@.service
+%{_unitdir}/user-basic@.target.wants/session-bind@.service
%post feature-session-bind
echo ""
diff --git a/units/session-bind@.service b/units/session-bind@.service
new file mode 100644
index 0000000..bb3e805
--- /dev/null
+++ b/units/session-bind@.service
@@ -0,0 +1,16 @@
+[Unit]
+PartOf=userlogin@%i.target
+Description=User session bind mount for %i
+Wants=wait-mount@opt-usr.service
+After=wait-mount@opt-usr.service
+ConditionPathIsMountPoint=!/opt/usr/apps
+ConditionPathIsMountPoint=!/opt/usr/media
+
+[Service]
+User=%i
+SmackProcessLabel=User
+Capabilities=cap_sys_admin=i
+SecureBits=keep-caps
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/usr/bin/session-bind