From 1bec325ee85192eba57673750b9e4a77a1a970c8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 24 Nov 2017 16:34:42 +0100 Subject: [PATCH 1/1] simplify afm-user-session process MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: If2739fd2c5a19d7cd31e117e1e79c0b51451552b Signed-off-by: José Bollo --- conf/system/CMakeLists.txt | 2 -- conf/system/afm-user-session@.service | 7 ++----- conf/system/afm-user-session@.target | 5 ++--- conf/system/afm-user-setup@.path | 8 -------- conf/system/afm-user-setup@.service | 11 ----------- conf/unit/afm-unit-debug.conf.in | 6 ++---- conf/unit/afm-unit.conf.in | 6 ++---- conf/unit/generate-unit-conf/provided.inc | 3 +-- conf/unit/generate-unit-conf/service.inc | 3 +-- conf/user/CMakeLists.txt | 1 - conf/user/afm-user-start.service | 8 -------- 11 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 conf/system/afm-user-setup@.path delete mode 100644 conf/system/afm-user-setup@.service delete mode 100644 conf/user/afm-user-start.service diff --git a/conf/system/CMakeLists.txt b/conf/system/CMakeLists.txt index d0605eb..74fdf37 100644 --- a/conf/system/CMakeLists.txt +++ b/conf/system/CMakeLists.txt @@ -35,8 +35,6 @@ if(NOT USE_SDK) ${CMAKE_CURRENT_SOURCE_DIR}/afm-system-daemon.conf ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-session@.service ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-session@.target - ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-setup@.path - ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-setup@.service DESTINATION ${UNITDIR_SYSTEM} ) diff --git a/conf/system/afm-user-session@.service b/conf/system/afm-user-session@.service index fae3e46..5bedf94 100644 --- a/conf/system/afm-user-session@.service +++ b/conf/system/afm-user-session@.service @@ -2,10 +2,7 @@ Description=Initiate afm-user-session %i Requires=systemd-user-sessions.service After=systemd-user-sessions.service -Requires=afm-user-session@%i.target -Before=afm-user-session@%i.target [Service] -PAMName=afm-user-session User=%i -Type=simple -ExecStart=/bin/sleep 2147483648 +PAMName=afm-user-session +ExecStart=/bin/systemctl --wait start afm-user-session@%i.target diff --git a/conf/system/afm-user-session@.target b/conf/system/afm-user-session@.target index 23bebfd..9503de1 100644 --- a/conf/system/afm-user-session@.target +++ b/conf/system/afm-user-session@.target @@ -1,4 +1,3 @@ [Unit] -Description=Target group of afm-user-session %i -Requires=afm-user-setup@%i.service -After=afm-user-setup@%i.service +Description=afm-user-session %i +After=user@%i.service diff --git a/conf/system/afm-user-setup@.path b/conf/system/afm-user-setup@.path deleted file mode 100644 index ca22c71..0000000 --- a/conf/system/afm-user-setup@.path +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=Path for setup completion of afm-user-session %i -DefaultDependencies=false -[Path] -PathExists=/run/user/%i/wayland-0 -PathExists=/run/user/%i/afm-user-started - - diff --git a/conf/system/afm-user-setup@.service b/conf/system/afm-user-setup@.service deleted file mode 100644 index 5d99d2d..0000000 --- a/conf/system/afm-user-setup@.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Setup completion of afm-user-session %i -Requires=afm-user-setup@%i.path -After=afm-user-setup@%i.path -Requires=afm-user-session@%i.service -After=afm-user-session@%i.service -[Service] -Type=oneshot -ExecStart=/bin/echo Complete setup of afm-user-session %i - - diff --git a/conf/unit/afm-unit-debug.conf.in b/conf/unit/afm-unit-debug.conf.in index d7fa47d..ed8d094 100644 --- a/conf/unit/afm-unit-debug.conf.in +++ b/conf/unit/afm-unit-debug.conf.in @@ -106,8 +106,7 @@ X-AFM--wgtdir={{:#metadata.install-dir}} X-AFM--workdir=/home/%i/app-data/{{:id}} %nl Requires=afm-user-session@%i.target -Requires=afm-user-setup@%i.service -After=afm-user-setup@%i.service +After=user@%i.service # Adds check to smack ConditionSecurity=smack %nl @@ -212,8 +211,7 @@ WantedBy=afm-user-session@.target %systemd-unit socket afm-api-ws-{{name}}@ [Unit] Description=Provides api {{name}} for user %i -Requires=afm-user-setup@%i.service -After=afm-user-setup@%i.service +After=user@%i.service DefaultDependencies=no [Socket] SmackLabel=* diff --git a/conf/unit/afm-unit.conf.in b/conf/unit/afm-unit.conf.in index bf9b32a..a0a397a 100644 --- a/conf/unit/afm-unit.conf.in +++ b/conf/unit/afm-unit.conf.in @@ -106,8 +106,7 @@ X-AFM--wgtdir={{:#metadata.install-dir}} X-AFM--workdir=/home/%i/app-data/{{:id}} %nl Requires=afm-user-session@%i.target -Requires=afm-user-setup@%i.service -After=afm-user-setup@%i.service +After=user@%i.service # Adds check to smack ConditionSecurity=smack %nl @@ -212,8 +211,7 @@ WantedBy=afm-user-session@.target %systemd-unit socket afm-api-ws-{{name}}@ [Unit] Description=Provides api {{name}} for user %i -Requires=afm-user-setup@%i.service -After=afm-user-setup@%i.service +After=user@%i.service DefaultDependencies=no [Socket] SmackLabel=* diff --git a/conf/unit/generate-unit-conf/provided.inc b/conf/unit/generate-unit-conf/provided.inc index 4f96426..96ac72c 100644 --- a/conf/unit/generate-unit-conf/provided.inc +++ b/conf/unit/generate-unit-conf/provided.inc @@ -14,8 +14,7 @@ dnl vim: set filetype=sysctl.conf.m4 syntax=sysctl.conf.m4: %systemd-unit socket afm-api-ws-{{name}}@ [Unit] Description=Provides api {{name}} for user %i -Requires=afm-user-setup@%i.service -After=afm-user-setup@%i.service +After=user@%i.service DefaultDependencies=no [Socket] diff --git a/conf/unit/generate-unit-conf/service.inc b/conf/unit/generate-unit-conf/service.inc index 2ff1de7..a860360 100644 --- a/conf/unit/generate-unit-conf/service.inc +++ b/conf/unit/generate-unit-conf/service.inc @@ -33,8 +33,7 @@ X-AFM--workdir=APP_DATA_DIR/{{:id}} %nl Requires=afm-user-session@%i.target -Requires=afm-user-setup@%i.service -After=afm-user-setup@%i.service +After=user@%i.service # Adds check to smack ConditionSecurity=smack diff --git a/conf/user/CMakeLists.txt b/conf/user/CMakeLists.txt index 1545b15..714a962 100644 --- a/conf/user/CMakeLists.txt +++ b/conf/user/CMakeLists.txt @@ -26,6 +26,5 @@ if(NOT USE_SDK) install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-daemon.conf DESTINATION ${SYSCONFDIR_DBUS_USER}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/afm-user-daemon.service DESTINATION ${UNITDIR_USER}) - install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-start.service DESTINATION ${UNITDIR_USER}) endif() diff --git a/conf/user/afm-user-start.service b/conf/user/afm-user-start.service deleted file mode 100644 index 130c460..0000000 --- a/conf/user/afm-user-start.service +++ /dev/null @@ -1,8 +0,0 @@ -[Unit] -Description=start mark of afm user - -[Service] -Type=oneshot -ExecStart=/bin/touch %t/afm-user-started - - -- 2.16.6