Set explicit path for services and units
[src/app-framework-main.git] / conf / afm-unit.conf.in
index 39a59d1..e6163e2 100644 (file)
@@ -13,7 +13,7 @@
 ;
 ;           Lines beginning with ; are firstly removed
 ;
-;    2. File instanciation
+;    2. File instantiation
 ;
 ;           Mustache (extended) substitutions are applied using JSON
 ;           data deduced from config.xml file of the widget.
@@ -62,7 +62,7 @@
 ;
 ;        X-AFM-description={{description}}
 ;
-;              Records the descritpion of the unit in the field "description"
+;              Records the description of the unit in the field "description"
 ;              of both the public and private object describing the unit.
 ;
 ;        X-AFM--wgtdir={{:#metadata.install-dir}}
@@ -100,6 +100,8 @@ X-AFM--wgtdir={{:#metadata.install-dir}}
 X-AFM--workdir={{&#metadata.app-data-dir}}/{{id}}
 %nl
 
+Wants=sockets.target
+
 # Adds check to smack
 ConditionSecurity=smack
 %nl
@@ -107,8 +109,8 @@ ConditionSecurity=smack
 # Automatic bound to required api
 {{#required-api}}
 {{#value=auto|ws}}
-BindsTo=afm-api-ws-{{name}}
-After=afm-api-ws-{{name}}
+BindsTo=afm-api-ws-{{name}}.socket
+After=afm-api-ws-{{name}}.socket
 {{/value=auto|ws}}
 {{/required-api}}
 %nl
@@ -130,6 +132,7 @@ SuccessExitStatus=0 SIGKILL
 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}}\
@@ -139,6 +142,7 @@ Environment=AFM_APP_INSTALL_DIR={{:#metadata.install-dir}}
 %systemd-unit service afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}
 {{/required-permission.urn:AGL:permission::public:hidden}}\
 
+
 ;---------------------------------------------------------------------------------
 ;----   text/html  application/vnd.agl.native  application/vnd.agl.service    ----
 ;---------------------------------------------------------------------------------
@@ -228,12 +232,10 @@ ExecStart={{:#metadata.install-dir}}/{{content.src}}
 ; auto start
 ;---------------------------------------------------------------------------------
 {{#required-permission.urn:AGL:permission::system:run-by-default}}
-{{^provided-api}}
 %nl
 [Install]
 WantedBy=default.target
 %systemd-unit wanted-by default.target
-{{/provided-api}}
 {{/required-permission.urn:AGL:permission::system:run-by-default}}
 
 %end systemd-unit
@@ -255,7 +257,7 @@ WantedBy=default.target
 
 [Socket]
 SmackLabel=*
-ListenStream=%t/bindings/{{name}}
+ListenStream=%t/apis/ws/{{name}}
 FileDescriptorName={{name}}
 
 {{#required-permission.urn:AGL:permission::public:hidden}}\
@@ -268,8 +270,8 @@ Service=afm-appli-{{idaver}}{{^#target=main}}@{{:#target}}{{/#target=main}}.serv
 ;---------------------------------------------------------------------------------
 %nl
 [Install]
-WantedBy=default.target
-%systemd-unit wanted-by default.target
+WantedBy=sockets.target
+%systemd-unit wanted-by sockets.target
 ;---------------------------------------------------------------------------------
 
 %end systemd-unit