summaryrefslogtreecommitdiff
path: root/units
diff options
context:
space:
mode:
Diffstat (limited to 'units')
-rw-r--r--units/lighttpd-lorry-controller-webapp.service12
-rw-r--r--units/lorry-controller-ls-troves.service8
-rw-r--r--units/lorry-controller-ls-troves.timer6
-rw-r--r--units/lorry-controller-minion@.service9
-rw-r--r--units/lorry-controller-readconf.service8
-rw-r--r--units/lorry-controller-readconf.timer6
-rw-r--r--units/lorry-controller-status.service9
-rw-r--r--units/lorry-controller-status.timer6
8 files changed, 64 insertions, 0 deletions
diff --git a/units/lighttpd-lorry-controller-webapp.service b/units/lighttpd-lorry-controller-webapp.service
new file mode 100644
index 0000000..0c04fac
--- /dev/null
+++ b/units/lighttpd-lorry-controller-webapp.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Lighttpd Web Server for Lorry Controller WEBAPP
+After=network.target
+
+[Service]
+PermissionsStartOnly=true
+User=lorry
+Group=lorry
+ExecStartPre=/usr/bin/install -d -o lorry -g lorry /run/lighttpd-lorry
+ExecStart=/usr/sbin/lighttpd -f /etc/lighttpd/lorry-controller-webapp-httpd.conf -D
+ExecStopPost=/bin/rm -r /run/lighttpd-lorry
+Restart=always
diff --git a/units/lorry-controller-ls-troves.service b/units/lorry-controller-ls-troves.service
new file mode 100644
index 0000000..fe97811
--- /dev/null
+++ b/units/lorry-controller-ls-troves.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Lorry Controller ls-troves
+After=lighttpd-lorry-controller-webapp.service
+
+[Service]
+ExecStart=/usr/bin/curl -o /dev/null -X POST --data "" http://localhost:12765/1.0/ls-troves
+User=lorry
+Group=lorry
diff --git a/units/lorry-controller-ls-troves.timer b/units/lorry-controller-ls-troves.timer
new file mode 100644
index 0000000..dbd157d
--- /dev/null
+++ b/units/lorry-controller-ls-troves.timer
@@ -0,0 +1,6 @@
+[Unit]
+Description=Lorry Controller ls-troves
+After=lighttpd-lorry-controller-webapp.service
+
+[Timer]
+OnUnitInactiveSec=60
diff --git a/units/lorry-controller-minion@.service b/units/lorry-controller-minion@.service
new file mode 100644
index 0000000..b63d996
--- /dev/null
+++ b/units/lorry-controller-minion@.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Lorry Controller MINION %i
+After=lighttpd-lorry-controller-webapp.service
+
+[Service]
+ExecStart=/usr/bin/lorry-controller-minion --config /etc/lorry-controller/minion.conf
+Restart=always
+User=lorry
+Group=lorry
diff --git a/units/lorry-controller-readconf.service b/units/lorry-controller-readconf.service
new file mode 100644
index 0000000..1f73b46
--- /dev/null
+++ b/units/lorry-controller-readconf.service
@@ -0,0 +1,8 @@
+[Unit]
+Description=Lorry Controller read config at startup
+After=lighttpd-lorry-controller-webapp.service
+
+[Service]
+ExecStart=/usr/bin/curl -o /dev/null -X POST --data "" http://localhost:12765/1.0/read-configuration
+User=lorry
+Group=lorry
diff --git a/units/lorry-controller-readconf.timer b/units/lorry-controller-readconf.timer
new file mode 100644
index 0000000..7e4f04e
--- /dev/null
+++ b/units/lorry-controller-readconf.timer
@@ -0,0 +1,6 @@
+[Unit]
+Description=Lorry Controller read config at startup
+After=lighttpd-lorry-controller-webapp.service
+
+[Timer]
+OnUnitInactiveSec=60
diff --git a/units/lorry-controller-status.service b/units/lorry-controller-status.service
new file mode 100644
index 0000000..381677b
--- /dev/null
+++ b/units/lorry-controller-status.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=Lorry Controller Status update
+After=lighttpd-lorry-controller-webapp.service
+
+[Service]
+ExecStart=/usr/bin/curl -o /dev/null http://localhost:12765/1.0/status
+Restart=no
+User=lorry
+Group=lorry
diff --git a/units/lorry-controller-status.timer b/units/lorry-controller-status.timer
new file mode 100644
index 0000000..1528b8c
--- /dev/null
+++ b/units/lorry-controller-status.timer
@@ -0,0 +1,6 @@
+[Unit]
+Description=Lorry Controller Status update
+After=lighttpd-lorry-controller-webapp.service
+
+[Timer]
+OnUnitInactiveSec=60