Last active
November 23, 2021 20:52
-
-
Save necessary129/5dfbb140e4727496b0ad2bf801c10fdc to your computer and use it in GitHub Desktop.
Systemd service for synapse workers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Matrix Synapse Worker %i | |
PartOf=matrix-synapse.service | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/python -B /path/to/synapse_worker.py -c /etc/matrix-synapse/homeserver.yaml -c /etc/matrix-synapse/conf.d/ -c /etc/matrix-synapse/workers/common.yaml -c /etc/matrix-synapse/workers/%i.yaml | |
User=matrix-synapse | |
WorkingDirectory=/var/lib/matrix-synapse | |
EnvironmentFile=/etc/default/matrix-synapse | |
[Install] | |
WantedBy=multi-user.target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from importlib import import_module | |
import sys | |
from synapse.config.homeserver import HomeServerConfig | |
from synapse.util.logcontext import LoggingContext | |
def main(): | |
config = HomeServerConfig.load_config("Worker", sys.argv[1:]) | |
app = config.worker_app | |
worker = import_module(app) | |
with LoggingContext('main'): | |
worker.start(sys.argv[1:]) | |
if __name__ == '__main__': | |
main() |
Found the issue. Synapse changed how configuration variables are referenced through a series of changes: matrix-org/synapse#10985.
Fxied it by changing config.worker_app
to config.worker.worker_app
in line number 9.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@necessary129 getting the following error after upgrading synapse from v1.44.0 to 1.47.1. any idea why?