diff options
author | Luca Corbatto <targodan@users.noreply.github.com> | 2019-03-15 10:51:46 +0100 |
---|---|---|
committer | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2019-03-15 09:51:46 +0000 |
commit | a6d84190eb3f0cd85a991a0c608aa1929658c68f (patch) | |
tree | a749fb15cd70b42e3f38268d6808aba680ebe3d3 /contrib/systemd-with-workers/system | |
parent | Add some stuff back to the .gitignore (#4843) (diff) | |
download | synapse-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')
3 files changed, 40 insertions, 0 deletions
diff --git a/contrib/systemd-with-workers/system/matrix-synapse-worker@.service b/contrib/systemd-with-workers/system/matrix-synapse-worker@.service new file mode 100644 index 0000000000..912984b9d2 --- /dev/null +++ b/contrib/systemd-with-workers/system/matrix-synapse-worker@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Synapse Matrix Worker +After=matrix-synapse.service +BindsTo=matrix-synapse.service + +[Service] +Type=simple +User=matrix-synapse +WorkingDirectory=/var/lib/matrix-synapse +EnvironmentFile=/etc/default/matrix-synapse +ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.%i --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --config-path=/etc/matrix-synapse/workers/%i.yaml +ExecReload=/bin/kill -HUP $MAINPID +Restart=always +RestartSec=3 + +[Install] +WantedBy=matrix-synapse.service 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 diff --git a/contrib/systemd-with-workers/system/matrix.target b/contrib/systemd-with-workers/system/matrix.target new file mode 100644 index 0000000000..aff97d03ef --- /dev/null +++ b/contrib/systemd-with-workers/system/matrix.target @@ -0,0 +1,7 @@ +[Unit] +Description=Contains matrix services like synapse, bridges and bots +After=network.target +AllowIsolate=no + +[Install] +WantedBy=multi-user.target |