aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Pearson <sam@sgp.me.uk>2018-10-02 15:48:42 +0100
committerSam Pearson <sam@sgp.me.uk>2018-10-03 08:38:04 +0100
commit52ab1010195bbd92152fb8a2635ca935241c319e (patch)
treee3c751d97d46227fbdd1e970cfe8f734cd8e7b9c
parent1991fc6e914a3f11c61358a59322280dee4b90eb (diff)
Example systemd service unit file
This adds a systemd service unit file for managing the FixMyStreet Catalyst process manager. This also updates the commonlib submodule with matching changes to our install scripts.
-rw-r--r--CHANGELOG.md1
m---------commonlib0
-rw-r--r--conf/systemd.example21
3 files changed, 22 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 24b439127..b5e85417f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -29,6 +29,7 @@
- Move away from FastCGI in sample conf/sysvinit config.
- Customised Vagrant box available, with an override option.
- Add Dockerfile and example Docker Compose setup.
+ - Add a sample systemd unit file for the Catalyst application server.
* v2.4 (6th September 2018)
- Security
diff --git a/commonlib b/commonlib
-Subproject 26a6eb8570abc8bd4cb10ecf1c961abd0cd671e
+Subproject 311a29848f6326152a292c2ab6c9adfcd3efee3
diff --git a/conf/systemd.example b/conf/systemd.example
new file mode 100644
index 000000000..1f8edf13c
--- /dev/null
+++ b/conf/systemd.example
@@ -0,0 +1,21 @@
+[Unit]
+Description=FixMyStreet Catalyst Application Server
+Documentation=https://fixmystreet.org/
+After=network.target
+
+[Service]
+Type=forking
+User=fms
+PIDFile=/var/www/fixmystreet/fixmystreet.pid
+ExecStartPre=mkdir /var/www/fixmystreet/logs
+ExecStart=/var/www/fixmystreet/fixmystreet/script/server \
+ --port 9000 \
+ --env deployment \
+ --daemonize \
+ --pid /var/www/fixmystreet/fixmystreet.pid \
+ --access-log /var/www/fixmystreet/logs/fixmystreet.access.log \
+ --error-log /var/www/fixmystreet/logs/fixmystreet.error.log
+ExecStop=kill -TERM $MAINPID
+
+[Install]
+WantedBy=multi-user.target