aboutsummaryrefslogtreecommitdiffstats
path: root/conf/unit/provided-api.inc
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-05-15 20:49:14 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-06-04 09:52:31 +0200
commit5b801a3e7b0465f88b785a155dd430ba09c56568 (patch)
tree82e06c5e13c7a4652170e17665f74496539a7022 /conf/unit/provided-api.inc
parenta5cf62686366f4a69becf62aa4d953e034c9bee4 (diff)
afm-unit.conf: Refactor its generation
The process of generating the file /etc/afm-unit.conf had be reworked to be more straight forward. Before that commit, a manual operation (a "make") had to be done before committing the repository. This was not efficient, error prone and kept temporary files in conf. That commit changes it by calling m4 through cmake. Bug-AGL: SPEC-2436 Change-Id: Ia32a810286471dde8a01387d157e33277d67411d Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'conf/unit/provided-api.inc')
-rw-r--r--conf/unit/provided-api.inc56
1 files changed, 56 insertions, 0 deletions
diff --git a/conf/unit/provided-api.inc b/conf/unit/provided-api.inc
new file mode 100644
index 0000000..bdee6c9
--- /dev/null
+++ b/conf/unit/provided-api.inc
@@ -0,0 +1,56 @@
+dnl vim: set filetype=sysctl.conf.m4 syntax=sysctl.conf.m4:
+;-------------------------------------------------------------------------------
+;---- 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
+
+Requires=UNIT_NAME_API_BASE({{name}})@%i.socket
+After=UNIT_NAME_API_BASE({{name}})@%i.socket
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=/bin/true
+
+%end systemd-unit
+
+;-------------------------------------------------------------------------------
+;---- T H E S O C K E T 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 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=API_PATH_WS/{{name}}
+FileDescriptorName={{name}}
+Service=UNIT_NAME_SERVICE
+
+%end systemd-unit
+
+
+