afm-unit.conf: Enforce starting after network
[src/app-framework-main.git] / conf / unit / generate-unit-conf / service.inc
index 88e4346..5b146ee 100644 (file)
@@ -34,22 +34,29 @@ X-AFM--workdir=APP_DATA_DIR/{{:id}}
 
 Requires=afm-user-session@%i.target
 After=user@%i.service
+After=Network.target
 
 # Adds check to smack
 ConditionSecurity=smack
 %nl
 
 # Automatic bound to required api
+{{#required-binding}}
+{{#value=extern}}
+BindsTo=UNIT_NAME_BINDING_SERVICE({{name}},%i)
+After=UNIT_NAME_BINDING_SERVICE({{name}},%i)
+{{/value=extern}}
+{{/required-binding}}
 {{#required-api}}
 {{#value=auto|ws}}
-BindsTo=UNIT_NAME_SOCKET_FOR({{name}})
-After=UNIT_NAME_SOCKET_FOR({{name}})
+BindsTo=UNIT_NAME_API_SERVICE({{name}},%i)
+After=UNIT_NAME_API_SERVICE({{name}},%i)
 {{/value=auto|ws}}
 {{/required-api}}
 {{#provided-api}}
 {{#value=ws|auto}}
-Requires=UNIT_NAME_SOCKET_FOR({{name}})
-After=UNIT_NAME_SOCKET_FOR({{name}})
+Requires=UNIT_NAME_API_SOCKET({{name}},%i)
+After=UNIT_NAME_API_SOCKET({{name}},%i)
 {{/value=ws|auto}}
 {{/provided-api}}