simplify afm-user-session process
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 24 Nov 2017 15:34:42 +0000 (16:34 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 24 Nov 2017 16:44:58 +0000 (17:44 +0100)
Change-Id: If2739fd2c5a19d7cd31e117e1e79c0b51451552b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
conf/system/CMakeLists.txt
conf/system/afm-user-session@.service
conf/system/afm-user-session@.target
conf/system/afm-user-setup@.path [deleted file]
conf/system/afm-user-setup@.service [deleted file]
conf/unit/afm-unit-debug.conf.in
conf/unit/afm-unit.conf.in
conf/unit/generate-unit-conf/provided.inc
conf/unit/generate-unit-conf/service.inc
conf/user/CMakeLists.txt
conf/user/afm-user-start.service [deleted file]

index d0605eb..74fdf37 100644 (file)
@@ -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-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}
        )
                DESTINATION
                        ${UNITDIR_SYSTEM}
        )
index fae3e46..5bedf94 100644 (file)
@@ -2,10 +2,7 @@
 Description=Initiate afm-user-session %i
 Requires=systemd-user-sessions.service
 After=systemd-user-sessions.service
 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]
 [Service]
-PAMName=afm-user-session
 User=%i
 User=%i
-Type=simple
-ExecStart=/bin/sleep 2147483648
+PAMName=afm-user-session
+ExecStart=/bin/systemctl --wait start afm-user-session@%i.target
index 23bebfd..9503de1 100644 (file)
@@ -1,4 +1,3 @@
 [Unit]
 [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 (file)
index ca22c71..0000000
+++ /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 (file)
index 5d99d2d..0000000
+++ /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
-
-
index d7fa47d..ed8d094 100644 (file)
@@ -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
 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
 # 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
 %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=*
 DefaultDependencies=no
 [Socket]
 SmackLabel=*
index bf9b32a..a0a397a 100644 (file)
@@ -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
 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
 # 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
 %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=*
 DefaultDependencies=no
 [Socket]
 SmackLabel=*
index 4f96426..96ac72c 100644 (file)
@@ -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
 %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]
 DefaultDependencies=no
 
 [Socket]
index 2ff1de7..a860360 100644 (file)
@@ -33,8 +33,7 @@ X-AFM--workdir=APP_DATA_DIR/{{:id}}
 %nl
 
 Requires=afm-user-session@%i.target
 %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
 
 # Adds check to smack
 ConditionSecurity=smack
index 1545b15..714a962 100644 (file)
@@ -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-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()
 
 endif()
 
diff --git a/conf/user/afm-user-start.service b/conf/user/afm-user-start.service
deleted file mode 100644 (file)
index 130c460..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Description=start mark of afm user
-
-[Service]
-Type=oneshot
-ExecStart=/bin/touch %t/afm-user-started
-
-