summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-05-02 14:27:29 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-24 17:44:57 +0100
commitb2cddbdc1ca61339330014092854ac33e0d9fb99 (patch)
tree8149ee3b280d631fdb3d705344062784fd57fb48
parentf2580ca3a5ec951216fe7cb2c092b13e8ffbdbe4 (diff)
afm-unit.conf: Rename generated systemd units
Uses a more uniform naming for units and allows to use templating for some other purpose. Change-Id: Ia99f84a8f4436fcce6cecf3b3720870d27e9e303 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--conf/afm-unit-debug.conf.in38
-rw-r--r--conf/afm-unit.conf.in42
2 files changed, 48 insertions, 32 deletions
diff --git a/conf/afm-unit-debug.conf.in b/conf/afm-unit-debug.conf.in
index 04639a3..75f7811 100644
--- a/conf/afm-unit-debug.conf.in
+++ b/conf/afm-unit-debug.conf.in
@@ -78,7 +78,7 @@
;---------------------------------------------------------------------------------
%begin systemd-unit
-# auto generated by wgtpkg-unit for {{id}} version {{version}} target {{:#target}} of {{idaver}}
+# auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
%nl
[Unit]
@@ -86,18 +86,26 @@ Description={{description}}
X-AFM-description={{description}}
X-AFM-name={{name.content}}
X-AFM-shortname={{name.short}}
+#***************
+# use X-AFM-id={{:id}}--{{:ver}}--{{:#target}}
+# instead of:
X-AFM-id={{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
-X-AFM-version={{version}}
+# when home screen will use real ids
+#**************
+X-AFM-version={{:version}}
X-AFM-author={{author.content}}
X-AFM-author-email={{author.email}}
X-AFM-width={{width}}
X-AFM-height={{height}}
-X-AFM--ID={{id}}
+{{#icon}}
+X-AFM-icon={{:#metadata.install-dir}}/{{:src}}
+{{/icon}}
+X-AFM--ID={{:id}}
X-AFM--target-name={{:#target}}
X-AFM--content={{content.src}}
X-AFM--type={{content.type}}
X-AFM--wgtdir={{:#metadata.install-dir}}
-X-AFM--workdir={{&#metadata.app-data-dir}}/{{id}}
+X-AFM--workdir={{&#metadata.app-data-dir}}/{{:id}}
%nl
Wants=sockets.target
@@ -117,7 +125,7 @@ After=afm-api-ws-{{name}}.socket
[Service]
EnvironmentFile=-@afm_confdir@/unit.env.d/*
-SmackProcessLabel=User::App::{{id}}
+SmackProcessLabel=User::App::{{:id}}
SuccessExitStatus=0 SIGKILL
{{#required-permission}}
@@ -129,8 +137,8 @@ SuccessExitStatus=0 SIGKILL
{{/required-permission}}
%nl
-WorkingDirectory=-{{&#metadata.app-data-dir}}/{{id}}
-ExecStartPre=/bin/mkdir -p {{&#metadata.app-data-dir}}/{{id}}
+WorkingDirectory=-{{&#metadata.app-data-dir}}/{{:id}}
+ExecStartPre=/bin/mkdir -p {{&#metadata.app-data-dir}}/{{:id}}
Environment=AFM_APP_INSTALL_DIR={{:#metadata.install-dir}}
Environment=PATH=/usr/sbin:/usr/bin:/sbin:/bin:{{:#metadata.install-dir}}
@@ -140,10 +148,10 @@ EnvironmentFile=-/var/run/afm-debug/{{idaver}}{{^#target=main}}@{{:#target}}{{/#
%systemd-unit user
{{#required-permission.urn:AGL:permission::public:hidden}}\
-%systemd-unit service afm-service-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
+%systemd-unit service afm-service-{{:id}}--{{:ver}}--{{:#target}}
{{/required-permission.urn:AGL:permission::public:hidden}}\
{{^required-permission.urn:AGL:permission::public:hidden}}\
-%systemd-unit service afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
+%systemd-unit service afm-appli-{{:id}}--{{:ver}}--{{:#target}}
{{/required-permission.urn:AGL:permission::public:hidden}}\
Environment=LD_LIBRARY_PATH=$ORIGIN/lib
@@ -168,9 +176,6 @@ ExecStart=/usr/bin/afb-daemon \
--token=HELLO \
--verbose \
--monitoring \
- {{#content.type=application/vnd.agl.service}} \
- --roothttp=. \
- {{/content.type=application/vnd.agl.service}} \
{{^content.type=application/vnd.agl.service}} \
{{#required-permission.urn:AGL:permission::public:no-htdocs}}\
--roothttp=. \
@@ -179,6 +184,9 @@ ExecStart=/usr/bin/afb-daemon \
--roothttp=htdocs \
{{/required-permission.urn:AGL:permission::public:no-htdocs}}\
{{/content.type=application/vnd.agl.service}} \
+ {{#content.type=application/vnd.agl.service}} \
+ --roothttp=. \
+ {{/content.type=application/vnd.agl.service}} \
{{#required-permission.urn:AGL:permission::public:applications:read}}\
--alias=/icons:{{:#metadata.icons-dir}} \
{{/required-permission.urn:AGL:permission::public:applications:read}}\
@@ -259,7 +267,7 @@ WantedBy=default.target
%begin systemd-unit
-# auto generated by wgtpkg-unit for {{id}} version {{version}} target {{:#target}} of {{idaver}}
+# auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
#
%systemd-unit user
%systemd-unit socket afm-api-ws-{{name}}
@@ -270,10 +278,10 @@ ListenStream=%t/apis/ws/{{name}}
FileDescriptorName={{name}}
{{#required-permission.urn:AGL:permission::public:hidden}}\
-Service=afm-service-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}.service
+Service=afm-service-{{:id}}--{{:ver}}--{{:#target}}.service
{{/required-permission.urn:AGL:permission::public:hidden}}\
{{^required-permission.urn:AGL:permission::public:hidden}}\
-Service=afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}.service
+Service=afm-appli-{{:id}}--{{:ver}}--{{:#target}}.service
{{/required-permission.urn:AGL:permission::public:hidden}}\
;---------------------------------------------------------------------------------
diff --git a/conf/afm-unit.conf.in b/conf/afm-unit.conf.in
index 237f8ce..7bd8581 100644
--- a/conf/afm-unit.conf.in
+++ b/conf/afm-unit.conf.in
@@ -78,7 +78,7 @@
;---------------------------------------------------------------------------------
%begin systemd-unit
-# auto generated by wgtpkg-unit for {{id}} version {{version}} target {{:#target}} of {{idaver}}
+# auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
%nl
[Unit]
@@ -86,18 +86,26 @@ Description={{description}}
X-AFM-description={{description}}
X-AFM-name={{name.content}}
X-AFM-shortname={{name.short}}
+#***************
+# use X-AFM-id={{:id}}--{{:ver}}--{{:#target}}
+# instead of:
X-AFM-id={{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
-X-AFM-version={{version}}
+# when home screen will use real ids
+#**************
+X-AFM-version={{:version}}
X-AFM-author={{author.content}}
X-AFM-author-email={{author.email}}
X-AFM-width={{width}}
X-AFM-height={{height}}
-X-AFM--ID={{id}}
+{{#icon}}
+X-AFM-icon={{:#metadata.install-dir}}/{{:src}}
+{{/icon}}
+X-AFM--ID={{:id}}
X-AFM--target-name={{:#target}}
X-AFM--content={{content.src}}
X-AFM--type={{content.type}}
X-AFM--wgtdir={{:#metadata.install-dir}}
-X-AFM--workdir={{&#metadata.app-data-dir}}/{{id}}
+X-AFM--workdir={{&#metadata.app-data-dir}}/{{:id}}
%nl
Wants=sockets.target
@@ -117,7 +125,7 @@ After=afm-api-ws-{{name}}.socket
[Service]
EnvironmentFile=-@afm_confdir@/unit.env.d/*
-SmackProcessLabel=User::App::{{id}}
+SmackProcessLabel=User::App::{{:id}}
SuccessExitStatus=0 SIGKILL
{{#required-permission}}
@@ -129,17 +137,17 @@ SuccessExitStatus=0 SIGKILL
{{/required-permission}}
%nl
-WorkingDirectory=-{{&#metadata.app-data-dir}}/{{id}}
-ExecStartPre=/bin/mkdir -p {{&#metadata.app-data-dir}}/{{id}}
+WorkingDirectory=-{{&#metadata.app-data-dir}}/{{:id}}
+ExecStartPre=/bin/mkdir -p {{&#metadata.app-data-dir}}/{{:id}}
Environment=AFM_APP_INSTALL_DIR={{:#metadata.install-dir}}
Environment=PATH=/usr/sbin:/usr/bin:/sbin:/bin:{{:#metadata.install-dir}}
%systemd-unit user
{{#required-permission.urn:AGL:permission::public:hidden}}\
-%systemd-unit service afm-service-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
+%systemd-unit service afm-service-{{:id}}--{{:ver}}--{{:#target}}
{{/required-permission.urn:AGL:permission::public:hidden}}\
{{^required-permission.urn:AGL:permission::public:hidden}}\
-%systemd-unit service afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
+%systemd-unit service afm-appli-{{:id}}--{{:ver}}--{{:#target}}
{{/required-permission.urn:AGL:permission::public:hidden}}\
Environment=LD_LIBRARY_PATH=$ORIGIN/lib
@@ -162,10 +170,7 @@ ExecStart=/usr/bin/afb-daemon \
--name afbd-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}} \
--rootdir={{:#metadata.install-dir}} \
--workdir={{&#metadata.app-data-dir}}/{{id}} \
- {{#content.type=application/vnd.agl.service}}\
- --no-httpd \
- {{/content.type=application/vnd.agl.service}}\
- {{^content.type=application/vnd.agl.service}}\
+ {{^content.type=application/vnd.agl.service}} \
--port={{:#metadata.http-port}} \
--random-token \
{{#required-permission.urn:AGL:permission::public:no-htdocs}}\
@@ -174,7 +179,10 @@ ExecStart=/usr/bin/afb-daemon \
{{^required-permission.urn:AGL:permission::public:no-htdocs}}\
--roothttp=htdocs \
{{/required-permission.urn:AGL:permission::public:no-htdocs}}\
- {{/content.type=application/vnd.agl.service}}\
+ {{/content.type=application/vnd.agl.service}} \
+ {{#content.type=application/vnd.agl.service}} \
+ --no-httpd \
+ {{/content.type=application/vnd.agl.service}} \
{{#required-permission.urn:AGL:permission::public:applications:read}}\
--alias=/icons:{{:#metadata.icons-dir}} \
{{/required-permission.urn:AGL:permission::public:applications:read}}\
@@ -255,7 +263,7 @@ WantedBy=default.target
%begin systemd-unit
-# auto generated by wgtpkg-unit for {{id}} version {{version}} target {{:#target}} of {{idaver}}
+# auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
#
%systemd-unit user
%systemd-unit socket afm-api-ws-{{name}}
@@ -266,10 +274,10 @@ ListenStream=%t/apis/ws/{{name}}
FileDescriptorName={{name}}
{{#required-permission.urn:AGL:permission::public:hidden}}\
-Service=afm-service-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}.service
+Service=afm-service-{{:id}}--{{:ver}}--{{:#target}}.service
{{/required-permission.urn:AGL:permission::public:hidden}}\
{{^required-permission.urn:AGL:permission::public:hidden}}\
-Service=afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}.service
+Service=afm-appli-{{:id}}--{{:ver}}--{{:#target}}.service
{{/required-permission.urn:AGL:permission::public:hidden}}\
;---------------------------------------------------------------------------------