summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-11-24 16:34:42 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-24 17:44:58 +0100
commit1bec325ee85192eba57673750b9e4a77a1a970c8 (patch)
tree31fa472c3a26021031d52633317fca322767fd93
parentdb8968de9b88e75828475c1e26b657af21b75beb (diff)
simplify afm-user-session process
Change-Id: If2739fd2c5a19d7cd31e117e1e79c0b51451552b Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--conf/system/CMakeLists.txt2
-rw-r--r--conf/system/afm-user-session@.service7
-rw-r--r--conf/system/afm-user-session@.target5
-rw-r--r--conf/system/afm-user-setup@.path8
-rw-r--r--conf/system/afm-user-setup@.service11
-rw-r--r--conf/unit/afm-unit-debug.conf.in6
-rw-r--r--conf/unit/afm-unit.conf.in6
-rw-r--r--conf/unit/generate-unit-conf/provided.inc3
-rw-r--r--conf/unit/generate-unit-conf/service.inc3
-rw-r--r--conf/user/CMakeLists.txt1
-rw-r--r--conf/user/afm-user-start.service8
11 files changed, 10 insertions, 50 deletions
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
-
-