aboutsummaryrefslogtreecommitdiffstats
path: root/conf/unit/afm-unit.conf.in
diff options
context:
space:
mode:
Diffstat (limited to 'conf/unit/afm-unit.conf.in')
-rw-r--r--conf/unit/afm-unit.conf.in48
1 files changed, 35 insertions, 13 deletions
diff --git a/conf/unit/afm-unit.conf.in b/conf/unit/afm-unit.conf.in
index 20a3b50..0cbe103 100644
--- a/conf/unit/afm-unit.conf.in
+++ b/conf/unit/afm-unit.conf.in
@@ -113,14 +113,14 @@ ConditionSecurity=smack
# Automatic bound to required api
{{#required-api}}
{{#value=auto|ws}}
-BindsTo=afm-api-ws-{{name}}@%i.socket
-After=afm-api-ws-{{name}}@%i.socket
+BindsTo=afm-api-{{name}}@%i.service
+After=afm-api-{{name}}@%i.service
{{/value=auto|ws}}
{{/required-api}}
{{#provided-api}}
{{#value=ws|auto}}
-Requires=afm-api-ws-{{name}}@%i.socket
-After=afm-api-ws-{{name}}@%i.socket
+Requires=afm-api-{{name}}@%i.service
+After=afm-api-{{name}}@%i.service
{{/value=ws|auto}}
{{/provided-api}}
%nl
@@ -200,17 +200,43 @@ WantedBy=afm-user-session@.target
%systemd-unit wanted-by afm-user-session@.target
{{/required-permission.urn:AGL:permission::system:run-by-default}}
%end systemd-unit
-;---------------------------------------------------------------------------------
-;---- P R O V I D E D A P I S ----
-;---------------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
+;---- P R O V I D E D A P I S ----
+;-------------------------------------------------------------------------------
{{#provided-api}}
-{{#value=ws|auto}}
+;-------------------------------------------------------------------------------
+;---- T H E S E R V I C E O F T H E A P I ----
+;-------------------------------------------------------------------------------
%begin systemd-unit
# auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
%systemd-unit system
-%systemd-unit socket afm-api-ws-{{name}}@
+%systemd-unit service afm-api-{{name}}@
[Unit]
Description=Provides api {{name}} for user %i
+X-AFM-API-TYPE={{value}}
+Requires=afm-user-setup@%i.service
+After=afm-user-setup@%i.service
+{{#value=ws|auto}}
+Requires=afm-api-{{name}}@%i.socket
+After=afm-api-{{name}}@%i.socket
+{{/value=ws|auto}}
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+{{#value=ws|auto}}
+ExecStart=/bin/true
+{{/value=ws|auto}}
+%end systemd-unit
+;-------------------------------------------------------------------------------
+;---- T H E S O C K E T O F T H E A P I ----
+;-------------------------------------------------------------------------------
+{{#value=ws|auto}}
+%begin systemd-unit
+# auto generated by wgtpkg-unit for {{:id}} version {{:version}} target {{:#target}} of {{:idaver}}
+%systemd-unit system
+%systemd-unit socket afm-api-{{name}}@
+[Unit]
+Description=Provides websocket api {{name}} for user %i
Requires=afm-user-setup@%i.service
After=afm-user-setup@%i.service
DefaultDependencies=no
@@ -221,10 +247,6 @@ SmackLabelIPOut=System
ListenStream=@afm_users_rundir@/%i/apis/ws/{{name}}
FileDescriptorName={{name}}
Service=afm-{{#required-permission.urn:AGL:permission::public:hidden}}service{{/required-permission.urn:AGL:permission::public:hidden}}{{^required-permission.urn:AGL:permission::public:hidden}}appli{{/required-permission.urn:AGL:permission::public:hidden}}-{{:id}}--{{:ver}}--{{:#target}}@%i.service
-%nl
-[Install]
-WantedBy=afm-user-session@.target
-%systemd-unit wanted-by afm-user-session@.target
%end systemd-unit
{{/value=ws|auto}}
{{/provided-api}}