From 52ab1010195bbd92152fb8a2635ca935241c319e Mon Sep 17 00:00:00 2001 From: Sam Pearson Date: Tue, 2 Oct 2018 15:48:42 +0100 Subject: 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. --- CHANGELOG.md | 1 + commonlib | 2 +- conf/systemd.example | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 conf/systemd.example 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 index 26a6eb857..311a29848 160000 --- a/commonlib +++ b/commonlib @@ -1 +1 @@ -Subproject commit 26a6eb8570abc8bd4cb10ecf1c961abd0cd671e3 +Subproject commit 311a29848f6326152a292c2ab6c9adfcd3efee38 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 -- cgit v1.2.3