From 97b29fd1c5339ea1590051fb1216d57fe52d345a Mon Sep 17 00:00:00 2001 From: José Bollo Date: Thu, 12 Oct 2017 23:10:07 +0200 Subject: af-main: Handle users from the system scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To simplify the management of users while keeping systemd as launcher, this evolution anchors the framework in the system level. This also introduce a new version of afm-system-daemon that is 100% a binding of the binder and that consequently offers natively a websocket API. Change-Id: I1bbb48d0c01d0f6fd3c8dfca90febbe8147cf204 Signed-off-by: José Bollo Reviewed-on: https://gerrit.automotivelinux.org/gerrit/12139 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account Reviewed-by: Stéphane Desneux Reviewed-by: Jan-Simon Moeller --- .../agl-login-manager/agl-login-manager_0.1.bb | 22 ++++++---------------- .../agl-login-manager/files/agl-user-session.pamd | 3 --- .../files/agl-user-session@.service | 18 ------------------ .../run-agl-postinsts/run-agl-postinsts | 1 + 4 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd delete mode 100644 meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service (limited to 'meta-agl') diff --git a/meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb b/meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb index 44a4fd36a..22f52c4ec 100644 --- a/meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb +++ b/meta-agl/recipes-config/agl-login-manager/agl-login-manager_0.1.bb @@ -8,18 +8,14 @@ inherit agl-graphical SRC_URI += " \ file://user-config.service \ file://user-config.path \ - file://agl-user-session.pamd \ - file://agl-user-session@.service \ " LOGIN_USER ??="1001 1002" -do_install_append() { +RDEPENDS_${PN} += "af-main" - install -d ${D}${sysconfdir}/pam.d/ - install -m 0644 ${WORKDIR}/agl-user-session.pamd ${D}${sysconfdir}/pam.d/agl-user-session +do_install_append() { - install -d ${D}${systemd_user_unitdir} install -d ${D}${systemd_user_unitdir}/default.target.wants install -m 0644 ${WORKDIR}/user-config.service ${D}${systemd_user_unitdir} install -m 0644 ${WORKDIR}/user-config.path ${D}${systemd_user_unitdir} @@ -29,19 +25,13 @@ do_install_append() { sed -e 's,@DISPLAY_XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g' \ -i ${D}${systemd_user_unitdir}/user-config.path - ln -sf ${systemd_user_unitdir}/user-config.path ${D}${systemd_user_unitdir}/default.target.wants + ln -s ../user-config.path ${D}${systemd_user_unitdir}/default.target.wants/user-config.path - install -d ${D}${systemd_unitdir}/system/ - install -d ${D}${systemd_unitdir}/system/multi-user.target.wants/ - install -m 0644 ${WORKDIR}/agl-user-session@.service ${D}${systemd_unitdir}/system/ + install -d ${D}${systemd_system_unitdir}/multi-user.target.wants/ for AGL_USER in ${LOGIN_USER};do - ln -sf ${systemd_system_unitdir}/agl-user-session@.service ${D}${systemd_unitdir}/system/multi-user.target.wants/agl-user-session@${AGL_USER}.service; + ln -s ../afm-user-session@.service ${D}${systemd_system_unitdir}/multi-user.target.wants/afm-user-session@${AGL_USER}.service done } -FILES_${PN} += "${sysconfdir}/pam.d/agl-user-session" -FILES_${PN} += "${systemd_user_unitdir}/*" -FILES_${PN} += "${libdir}/systemd/user/default.target.wants/*" -FILES_${PN} += "${systemd_unitdir}/system/agl-user-session@.service" -FILES_${PN} += "${systemd_unitdir}/system/multi-user.target.wants/*" +FILES_${PN} += "${systemd_user_unitdir} ${systemd_system_unitdir}" diff --git a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd b/meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd deleted file mode 100644 index 462c3648b..000000000 --- a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session.pamd +++ /dev/null @@ -1,3 +0,0 @@ -account include common-account -session required pam_loginuid.so -session include common-session diff --git a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service b/meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service deleted file mode 100644 index b128a40c8..000000000 --- a/meta-agl/recipes-config/agl-login-manager/files/agl-user-session@.service +++ /dev/null @@ -1,18 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=User Manager for UID %i -After=systemd-user-sessions.service - -[Service] -User=%i -PAMName=agl-user-session -ExecStart=-/bin/sleep 2147483648 -KillMode=mixed -Delegate=yes -TasksMax=infinity diff --git a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts index 87ec0e13b..1d1a5a059 100755 --- a/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts +++ b/meta-agl/recipes-devtools/run-agl-postinsts/run-agl-postinsts/run-agl-postinsts @@ -40,6 +40,7 @@ exec_postinst_scriptlets() { remove_agl_pi_dir=1 exec_postinst_scriptlets +systemctl daemon-reload # since all postinstalls executed successfully, remove the postinstalls directory if [ $remove_agl_pi_dir = 1 ]; then -- cgit 1.2.3-korg