summaryrefslogtreecommitdiffstats
path: root/conf
diff options
context:
space:
mode:
Diffstat (limited to 'conf')
-rw-r--r--conf/afm-unit.conf55
1 files changed, 43 insertions, 12 deletions
diff --git a/conf/afm-unit.conf b/conf/afm-unit.conf
index 86ab626..4cbfc87 100644
--- a/conf/afm-unit.conf
+++ b/conf/afm-unit.conf
@@ -49,6 +49,27 @@
;
; tells to install a link to unit in the wants of NAME
;
+; Setting variables:
+;
+; AFM uses the feature of systemd that completely ignores options prefixed
+; with X-
+;
+; Consequently, options starting with X-AFM- are recorded as public data
+; about the application and options starting starting with X-AFM-- are
+; recorded as private data.
+;
+; Examples:
+;
+; X-AFM-description={{description}}
+;
+; Records the descritpion of the unit in the field "description"
+; of both the public and private object describing the unit.
+;
+; X-AFM--wgtdir={{:#metadata.install-dir}}
+;
+; Records the installation directory path in the field "wgtdir"
+; of the private object only.
+;
;---------------------------------------------------------------------------------
{{#targets}}
%begin systemd-unit
@@ -56,16 +77,23 @@
# auto generated by wgtpkg-unit for {{id}} version {{version}} target {{:#target}}
%nl
-[unit]
+[Unit]
Description={{description}}
-X-AGL-Name={{name.content}}
-X-AGL-Name-Short={{name.short}}
-X-AGL-Id={{id}}
-X-AGL-Idaver={{idaver}}
-X-AGL-Target-Name={{:#target}}
-X-AGL-Author={{author.content}}
-X-AGL-Author-email={{author.email}}
-X-AGL-HTTP-port={{:#metadata.http-port}}
+X-AFM-description={{description}}
+X-AFM-name={{name.content}}
+X-AFM-shortname={{name.short}}
+X-AFM-id={{idaver}}
+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}}
+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}}
%nl
# Adds check to smack
@@ -92,7 +120,8 @@ SuccessExitStatus=0 SIGKILL
{{/required-permission}}
%nl
-WorkingDirectory={{&#metadata.app-data-dir}}
+WorkingDirectory=-{{&#metadata.app-data-dir}}/{{id}}
+ExecStartPre=/bin/mkdir -p {{&#metadata.app-data-dir}}/{{id}}
Environment=AFM_APP_INSTALL_DIR={{:#metadata.install-dir}}
@@ -103,6 +132,7 @@ Environment=AFM_APP_INSTALL_DIR={{:#metadata.install-dir}}
%systemd-unit service afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
+X-AFM--http-port={{:#metadata.http-port}}
ExecStart=/usr/bin/afb-daemon --port={{:#metadata.http-port}} --random-token \
--rootdir={{:#metadata.install-dir}} \
--workdir={{&#metadata.app-data-dir}}/{{id}} \
@@ -141,6 +171,7 @@ ExecStart=/usr/bin/afb-daemon --port={{:#metadata.http-port}} --random-token \
%systemd-unit user
%systemd-unit service afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
+
Environment=LD_LIBRARY_PATH=$ORIGIN/$LIB
ExecStart={{:#metadata.install-dir}}/{{content.src}}
@@ -174,7 +205,7 @@ ExecStart=/usr/bin/afb-daemon \
%systemd-unit user
%systemd-unit socket afm-service-{{:#target}}
-[socket]
+[Socket]
SmackLabel=*
ListenStream=%t/bindings/{{:#target}}
FileDescriptorName={{:#target}}
@@ -185,7 +216,7 @@ FileDescriptorName={{:#target}}
;---------------------------------------------------------------------------------
{{#required-permission.urn:AGL:permission::system:run-by-default}}
-[install]
+[Install]
WantedBy=default.target
%systemd-unit wanted-by default.target
{{/required-permission.urn:AGL:permission::system:run-by-default}}