summary refs log tree commit diff
path: root/contrib/systemd-with-workers/system/matrix-synapse.service
diff options
context:
space:
mode:
authorLuca Corbatto <targodan@users.noreply.github.com>2019-03-15 10:51:46 +0100
committerRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2019-03-15 09:51:46 +0000
commita6d84190eb3f0cd85a991a0c608aa1929658c68f (patch)
treea749fb15cd70b42e3f38268d6808aba680ebe3d3 /contrib/systemd-with-workers/system/matrix-synapse.service
parentAdd some stuff back to the .gitignore (#4843) (diff)
downloadsynapse-a6d84190eb3f0cd85a991a0c608aa1929658c68f.tar.xz
Add systemd setup that supports workers (#4662)
This setup is a way to manage workers with systemd. It does however not
require workers. You can use this setup without workers. You just have
to make sure that the homeserver is forking and writes its PID file
to the location the service is looking in.

The currently distributed setup in the debian package does not work in
conjunction with workers.

* Adds changelog

* Lets systemd handle the forking

Sets all services to `type=simple` and disables daemonizing on the
synapse side.

* Formats readme to 80 columns per line

* Allows for full restart of all workers

* Changes README to reflect the new setup

* Adds dot to end of changelog file

* Removes surplus word

Co-Authored-By: targodan <targodan@users.noreply.github.com>

* Adds missing word

Co-Authored-By: targodan <targodan@users.noreply.github.com>

* Fixes linebreak

Co-Authored-By: targodan <targodan@users.noreply.github.com>

* Fixes unit type
Diffstat (limited to 'contrib/systemd-with-workers/system/matrix-synapse.service')
-rw-r--r--contrib/systemd-with-workers/system/matrix-synapse.service16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/systemd-with-workers/system/matrix-synapse.service b/contrib/systemd-with-workers/system/matrix-synapse.service
new file mode 100644
index 0000000000..8bb4e400dc
--- /dev/null
+++ b/contrib/systemd-with-workers/system/matrix-synapse.service
@@ -0,0 +1,16 @@
+[Unit]
+Description=Synapse Matrix Homeserver
+
+[Service]
+Type=simple
+User=matrix-synapse
+WorkingDirectory=/var/lib/matrix-synapse
+EnvironmentFile=/etc/default/matrix-synapse
+ExecStartPre=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --generate-keys
+ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.homeserver --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/
+ExecReload=/bin/kill -HUP $MAINPID
+Restart=always
+RestartSec=3
+
+[Install]
+WantedBy=matrix.target