Add network and bluetooth permissions to service template 96/25696/1
authorScott Murray <scott.murray@konsulko.com>
Tue, 1 Dec 2020 00:25:53 +0000 (19:25 -0500)
committerScott Murray <scott.murray@konsulko.com>
Tue, 1 Dec 2020 00:30:39 +0000 (19:30 -0500)
Add new public:network and public:bluetooth permissions that currently
drive adding dependencies on network.target and bluetooth.target,
respectively.  This allows related bindings to depend on those to
avoid start up races.  In the future, these permissions could perhaps
be tied to configuring DBus access control of the related services.

Bug-AGL: SPEC-3509

Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I582691bfe223a01ce80f04a4b0a1463d58287a9c

conf/unit/service.inc

index ea08220..dcc576b 100644 (file)
@@ -46,13 +46,21 @@ 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
 %nl