From acdb952366b31b7f949be5f22c3b26cb0dfd7d8e Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Fri, 15 Nov 2019 12:04:49 -0500 Subject: [PATCH 01/13] Modify systemd unit file reference to align with installation instructions Original file referenced locations not referenced in the installation instructions. These commits bring that closer to what is prescribed as well as adding a readme for helping the less experienced. --- contrib/systemd/README.md | 17 +++++++++++++++++ contrib/systemd/matrix-synapse.service | 8 ++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 contrib/systemd/README.md diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md new file mode 100644 index 000000000000..491d7ae17476 --- /dev/null +++ b/contrib/systemd/README.md @@ -0,0 +1,17 @@ +# Setup Synapse with Systemd +This is a setup for managing synapse with the user contributed systemd unit +file. It provides a `matrix-synapse` systemd unit file that should be tailored +to accomidate your installation in accordinance with the installation +instructions provided in [installation instructions](https://github.com/matrix-org/synapse/blob/master/INSTALL.md). + +## Setup +1. Under the service section, ensure the `User` variable matches which user +you installed synapse under and wish to run it as. +2. Under the service section, ensure the `WorkingDirectory` variablei matches +where you have installed synapse. +3. Under the service section, ensure the `ExecStart` variable matches the +appropriate locations of your installation. +4. Copy the `mastodon-synapse.service` to `/etc/systemd/system/` +5. Start the service: `sudo systemctl start matrix-synapse` +6. Verify the service: `sudo systemctl status matrix-synapse` +7. *optional* Enable the service at boot: `sudo systemctl enable matrix-synapse` diff --git a/contrib/systemd/matrix-synapse.service b/contrib/systemd/matrix-synapse.service index 38d369ea3d49..40f7853731ae 100644 --- a/contrib/systemd/matrix-synapse.service +++ b/contrib/systemd/matrix-synapse.service @@ -4,8 +4,12 @@ # systemctl enable matrix-synapse # systemctl start matrix-synapse # +# This assumes that Synapse has been installed by a user named +# synapse +# # This assumes that Synapse has been installed in a virtualenv in -# /opt/synapse/env. +# the user's home directory +# /home/synapse/synapse/env. # # **NOTE:** This is an example service file that may change in the future. If you # wish to use this please copy rather than symlink it. @@ -23,7 +27,7 @@ User=synapse Group=nogroup WorkingDirectory=/opt/synapse -ExecStart=/opt/synapse/env/bin/python -m synapse.app.homeserver --config-path=/opt/synapse/homeserver.yaml +ExecStart=/home/synapse/synapse/env/bin/python -m synapse.app.homeserver --config-path=/home/synapse/synapse/homeserver.yaml SyslogIdentifier=matrix-synapse # adjust the cache factor if necessary From 3680219016c21a209e62ba95074e003af27a946e Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Fri, 15 Nov 2019 13:33:17 -0500 Subject: [PATCH 02/13] added changelog note --- changelog.d/6369.doc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6369.doc diff --git a/changelog.d/6369.doc b/changelog.d/6369.doc new file mode 100644 index 000000000000..6db351d7db72 --- /dev/null +++ b/changelog.d/6369.doc @@ -0,0 +1 @@ +Update documentation and variables in user contributed systemd reference file. From 4b1c13dba567374e6f3536ca0c53f0c6bda6c058 Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:39:44 -0500 Subject: [PATCH 03/13] Update contrib/systemd/README.md Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 491d7ae17476..40699cb7b610 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -1,7 +1,7 @@ # Setup Synapse with Systemd This is a setup for managing synapse with the user contributed systemd unit file. It provides a `matrix-synapse` systemd unit file that should be tailored -to accomidate your installation in accordinance with the installation +to accommodate your installation in accordance with the installation instructions provided in [installation instructions](https://github.com/matrix-org/synapse/blob/master/INSTALL.md). ## Setup From 4f658b674bce0e2aaffcbe2b71329e5ea0f7eeca Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:40:06 -0500 Subject: [PATCH 04/13] Update contrib/systemd/README.md Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 40699cb7b610..eb72918994a2 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -1,5 +1,5 @@ # Setup Synapse with Systemd -This is a setup for managing synapse with the user contributed systemd unit +This is a setup for managing synapse with a user contributed systemd unit file. It provides a `matrix-synapse` systemd unit file that should be tailored to accommodate your installation in accordance with the installation instructions provided in [installation instructions](https://github.com/matrix-org/synapse/blob/master/INSTALL.md). From 2c430d92ce3895e97978592d5ba0fe59fbc7290b Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:40:21 -0500 Subject: [PATCH 05/13] Update contrib/systemd/README.md Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index eb72918994a2..76e5e9b278e7 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -7,7 +7,7 @@ instructions provided in [installation instructions](https://github.com/matrix-o ## Setup 1. Under the service section, ensure the `User` variable matches which user you installed synapse under and wish to run it as. -2. Under the service section, ensure the `WorkingDirectory` variablei matches +2. Under the service section, ensure the `WorkingDirectory` variable matches where you have installed synapse. 3. Under the service section, ensure the `ExecStart` variable matches the appropriate locations of your installation. From 67c8fef77b5027f113154c4197c944159c5eb471 Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:40:46 -0500 Subject: [PATCH 06/13] Update contrib/systemd/README.md lol, the shame of working on two different things at one time :D Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 76e5e9b278e7..422ad03abfa6 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -11,7 +11,7 @@ you installed synapse under and wish to run it as. where you have installed synapse. 3. Under the service section, ensure the `ExecStart` variable matches the appropriate locations of your installation. -4. Copy the `mastodon-synapse.service` to `/etc/systemd/system/` +4. Copy the `matrix-synapse.service` to `/etc/systemd/system/` 5. Start the service: `sudo systemctl start matrix-synapse` 6. Verify the service: `sudo systemctl status matrix-synapse` 7. *optional* Enable the service at boot: `sudo systemctl enable matrix-synapse` From 9b5e7c6d9c3f900e5f4bdeccf7ebed6b620f34fc Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:41:05 -0500 Subject: [PATCH 07/13] Update contrib/systemd/README.md Good to know, thanks! Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 422ad03abfa6..22b98e8d0a63 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -2,7 +2,7 @@ This is a setup for managing synapse with a user contributed systemd unit file. It provides a `matrix-synapse` systemd unit file that should be tailored to accommodate your installation in accordance with the installation -instructions provided in [installation instructions](https://github.com/matrix-org/synapse/blob/master/INSTALL.md). +instructions provided in [installation instructions](../../INSTALL.md). ## Setup 1. Under the service section, ensure the `User` variable matches which user From 0a88c4a8871616c92bf8bb1195f4e03349e0510b Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:41:36 -0500 Subject: [PATCH 08/13] Update contrib/systemd/matrix-synapse.service Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/matrix-synapse.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/matrix-synapse.service b/contrib/systemd/matrix-synapse.service index 40f7853731ae..bef2d1a1964a 100644 --- a/contrib/systemd/matrix-synapse.service +++ b/contrib/systemd/matrix-synapse.service @@ -5,7 +5,7 @@ # systemctl start matrix-synapse # # This assumes that Synapse has been installed by a user named -# synapse +# synapse. # # This assumes that Synapse has been installed in a virtualenv in # the user's home directory From e353cb456b92b79de851a333ada5591866e2656c Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:41:46 -0500 Subject: [PATCH 09/13] Update contrib/systemd/README.md Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 22b98e8d0a63..13f69bafef9c 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -12,6 +12,6 @@ where you have installed synapse. 3. Under the service section, ensure the `ExecStart` variable matches the appropriate locations of your installation. 4. Copy the `matrix-synapse.service` to `/etc/systemd/system/` -5. Start the service: `sudo systemctl start matrix-synapse` +5. Start Synapse: `sudo systemctl start matrix-synapse` 6. Verify the service: `sudo systemctl status matrix-synapse` 7. *optional* Enable the service at boot: `sudo systemctl enable matrix-synapse` From 55037ecfc9e9d6c09c27f31b501f1ac0e9e39436 Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:41:56 -0500 Subject: [PATCH 10/13] Update contrib/systemd/README.md Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 13f69bafef9c..75627c3877b5 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -13,5 +13,5 @@ where you have installed synapse. appropriate locations of your installation. 4. Copy the `matrix-synapse.service` to `/etc/systemd/system/` 5. Start Synapse: `sudo systemctl start matrix-synapse` -6. Verify the service: `sudo systemctl status matrix-synapse` +6. Verify Synapse is running: `sudo systemctl status matrix-synapse` 7. *optional* Enable the service at boot: `sudo systemctl enable matrix-synapse` From d4c5018bf2094b123b2611dbf0659b7de0ad703c Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:42:12 -0500 Subject: [PATCH 11/13] Update contrib/systemd/README.md Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/README.md b/contrib/systemd/README.md index 75627c3877b5..5d42b3464f68 100644 --- a/contrib/systemd/README.md +++ b/contrib/systemd/README.md @@ -14,4 +14,4 @@ appropriate locations of your installation. 4. Copy the `matrix-synapse.service` to `/etc/systemd/system/` 5. Start Synapse: `sudo systemctl start matrix-synapse` 6. Verify Synapse is running: `sudo systemctl status matrix-synapse` -7. *optional* Enable the service at boot: `sudo systemctl enable matrix-synapse` +7. *optional* Enable Synapse to start at system boot: `sudo systemctl enable matrix-synapse` From 632bc38e05711d9998acdfe13f69bb7e075a82b2 Mon Sep 17 00:00:00 2001 From: Clifford Garwood II Date: Tue, 19 Nov 2019 11:42:40 -0500 Subject: [PATCH 12/13] Update contrib/systemd/matrix-synapse.service Co-Authored-By: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> --- contrib/systemd/matrix-synapse.service | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/systemd/matrix-synapse.service b/contrib/systemd/matrix-synapse.service index bef2d1a1964a..1debd8b462f5 100644 --- a/contrib/systemd/matrix-synapse.service +++ b/contrib/systemd/matrix-synapse.service @@ -9,7 +9,6 @@ # # This assumes that Synapse has been installed in a virtualenv in # the user's home directory -# /home/synapse/synapse/env. # # **NOTE:** This is an example service file that may change in the future. If you # wish to use this please copy rather than symlink it. From ee39ff53d7db22f8e96891067e7233e1b138fabf Mon Sep 17 00:00:00 2001 From: Clifford Garwood Date: Tue, 19 Nov 2019 16:18:55 -0500 Subject: [PATCH 13/13] Adding @anoadragon453 recommendation --- contrib/systemd/matrix-synapse.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/systemd/matrix-synapse.service b/contrib/systemd/matrix-synapse.service index 1debd8b462f5..bd492544b660 100644 --- a/contrib/systemd/matrix-synapse.service +++ b/contrib/systemd/matrix-synapse.service @@ -8,7 +8,7 @@ # synapse. # # This assumes that Synapse has been installed in a virtualenv in -# the user's home directory +# the user's home directory: `/home/synapse/synapse/env`. # # **NOTE:** This is an example service file that may change in the future. If you # wish to use this please copy rather than symlink it.