aboutsummaryrefslogtreecommitdiffstats
path: root/conf/unit/generate-unit-conf/provided-api.inc
blob: 8a667a932579331ac0bec266228210cb41f08a53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
dnl vim: set filetype=sysctl.conf.m4 syntax=sysctl.conf.m4:
;-------------------------------------------------------------------------------
;----        P R O V I D E D   A P I S                                      ----
;-------------------------------------------------------------------------------

{{#provided-api}}

;-------------------------------------------------------------------------------
;----        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 service UNIT_NAME_API_BASE({{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=UNIT_NAME_API_BASE({{name}})@%i.socket
After=UNIT_NAME_API_BASE({{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 UNIT_NAME_API_BASE({{name}})@
[Unit]
Description=Provides websocket api {{name}} for user %i
Requires=afm-user-setup@%i.service
After=afm-user-setup@%i.service
DefaultDependencies=no

[Socket]
SmackLabel=*
SmackLabelIPIn=System
SmackLabelIPOut=System
ListenStream=USER_RUN_DIR/apis/ws/{{name}}
FileDescriptorName={{name}}
Service=UNIT_NAME_SERVICE

%end systemd-unit


{{/value=ws|auto}}

{{/provided-api}}