aboutsummaryrefslogtreecommitdiffstats
path: root/conf/system
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-07-19 11:29:36 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2018-07-19 15:38:29 +0200
commit8c7132a146aa744f167ea2fc45dcd8d53018ecc0 (patch)
tree62bb28dc2831417d2406a30b4c8b38bd133b45bb /conf/system
parentd8d819bcde18c8b4b5dfbdf610a6fc5e04fa54bf (diff)
Creates systemd service for APIs
Before this change, APIs were only provided as binder's exported websockets. This forbade ability to use symbolic links. Allowing links is interesting for having platform sockets and for linked api (not using socket). The API afm-main is a platform API. It must run at system level and must be available for all user clients. To achieve it, we use a link. Bug-AGL: SPEC-1592 Change-Id: I8753f83373755eb7fc2d2cc50251b8f738b61b03 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'conf/system')
-rw-r--r--conf/system/CMakeLists.txt2
-rw-r--r--conf/system/afm-api-afm-main@.service.in13
2 files changed, 15 insertions, 0 deletions
diff --git a/conf/system/CMakeLists.txt b/conf/system/CMakeLists.txt
index c36128f..26fc562 100644
--- a/conf/system/CMakeLists.txt
+++ b/conf/system/CMakeLists.txt
@@ -20,6 +20,7 @@ cmake_minimum_required(VERSION 2.8)
configure_file(afm-system-daemon.service.in afm-system-daemon.service)
configure_file(afm-system-daemon.socket.in afm-system-daemon.socket)
+configure_file(afm-api-afm-main@.service.in afm-api-afm-main@.service)
if(NOT USE_SDK)
set(SYSCONFDIR_DBUS_SYSTEM ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d CACHE STRING "Path to dbus system configuration files")
@@ -30,6 +31,7 @@ if(NOT USE_SDK)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/afm-user-session.pamd DESTINATION ${SYSCONFDIR_PAMD} RENAME afm-user-session)
install(
FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/afm-api-afm-main@.service
${CMAKE_CURRENT_BINARY_DIR}/afm-system-daemon.service
${CMAKE_CURRENT_BINARY_DIR}/afm-system-daemon.socket
${CMAKE_CURRENT_SOURCE_DIR}/afm-system-setup.service
diff --git a/conf/system/afm-api-afm-main@.service.in b/conf/system/afm-api-afm-main@.service.in
new file mode 100644
index 0000000..f5b2519
--- /dev/null
+++ b/conf/system/afm-api-afm-main@.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=Provides api afm-main for user %i
+X-AFM-API-TYPE=ws
+
+Requires=afm-user-setup@%i.service
+After=afm-user-setup@%i.service
+Requires=afm-system-daemon.socket
+After=afm-system-daemon.socket
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/ln -s @afm_platform_rundir@/apis/ws/afm-main /run/user/%i/apis/ws/afm-main