mirror of
https://github.com/element-hq/synapse.git
synced 2026-03-29 06:39:55 +00:00
Summary - drop the `systemd` extra from `pyproject.toml` and the `systemd-python` optional dependency - this means we don't ship the journald log handler, so it clarifies the docs how to install that in the venv - ensure the Debian virtualenv build keeps shipping `systemd-python>=231` in the venv, so the packaged log config can keep using `systemd.journal.JournalHandler` Context of this is the following: > Today in my 'how hard would it be to move to uv' journey: https://github.com/systemd/python-systemd/issues/167 > > The gist of it is that uv really wants to create a universal lock file, which means it needs to be able to resolve the package metadata, even for packages locked for other platforms. In the case of systemd-python, they use mesonpy as build backend, which doesn't implement prepare_metadata_for_build_wheel, which means it needs to run meson to be able to resolve the package metadata. And it will hard-fail if libsystemd dev headers aren't available 😭 > > [*message in #synapse-dev:matrix.org*](https://matrix.to/#/!i5D5LLct_DYG-4hQprLzrxdbZ580U9UB6AEgFnk6rZQ/$OKLB3TJVXAwq43sAZFJ-_PvMMzl4P_lWmSAtlmsoMuM?via=element.io&via=matrix.org&via=beeper.com)
Setup Synapse with Systemd
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.
Setup
- Under the service section, ensure the
Uservariable matches which user you installed synapse under and wish to run it as. - Under the service section, ensure the
WorkingDirectoryvariable matches where you have installed synapse. - Under the service section, ensure the
ExecStartvariable matches the appropriate locations of your installation. - Copy the
matrix-synapse.serviceto/etc/systemd/system/ - Start Synapse:
sudo systemctl start matrix-synapse - Verify Synapse is running:
sudo systemctl status matrix-synapse - optional Enable Synapse to start at system boot:
sudo systemctl enable matrix-synapse
Logging
If you use contrib/systemd/log_config.yaml, install systemd-python in the
same Python environment as Synapse. The config uses
systemd.journal.JournalHandler, which requires that package.