Add network and bluetooth permissions to service template
[src/app-framework-main.git] / conf / unit / service.inc
index a520e3b..dcc576b 100644 (file)
@@ -46,7 +46,20 @@ Requires=afm-user-session@%i.target
 After=user@%i.service
 ENDIF
 
-After=Network.target
+IF_PERM(:public:display)
+BindsTo=weston@display.service
+After=weston@display.service
+ENDIF
+
+IF_PERM(:public:bluetooth)
+Wants=bluetooth.target
+After=bluetooth.target
+ENDIF
+
+IF_PERM(:public:network)
+Wants=network.target
+After=network.target
+ENDIF
 
 # Adds check to smack
 ConditionSecurity=smack
@@ -55,14 +68,14 @@ ConditionSecurity=smack
 # Automatic bound to required api
 {{#required-binding}}
 {{#value=extern}}
-BindsTo=UNIT_NAME_BINDING_SERVICE({{name}})
+Requires=UNIT_NAME_BINDING_SERVICE({{name}})
 After=UNIT_NAME_BINDING_SERVICE({{name}})
 {{/value=extern}}
 {{/required-binding}}
 
 {{#required-api}}
 {{#value=auto|ws}}
-BindsTo=UNIT_NAME_API_SERVICE({{name}})
+Requires=UNIT_NAME_API_SERVICE({{name}})
 After=UNIT_NAME_API_SERVICE({{name}})
 {{/value=auto|ws}}
 {{/required-api}}