[__matrix_synapse_worker] various tweaks and fixes following testing

This commit is contained in:
fnux 2021-02-18 14:10:19 +01:00
parent adc335669d
commit 6487839cf5
No known key found for this signature in database
GPG key ID: 4502C902C00A1E12
5 changed files with 23 additions and 11 deletions

View file

@ -15,9 +15,9 @@ NotifyAccess=main
User=matrix-synapse
WorkingDirectory=/var/lib/matrix-synapse
EnvironmentFile=/etc/default/matrix-synapse
ExecStart=/opt/venvs/matrix-synapse/bin/python -m synapse.app.generic_worker --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --config-path=/etc/matrix-synapse/workers/%i.yaml
ExecStart=/usr/bin/python3 -m synapse.app.generic_worker --config-path=/etc/matrix-synapse/homeserver.yaml --config-path=/etc/matrix-synapse/conf.d/ --config-path=/etc/matrix-synapse/workers/
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
Restart=on-failure
RestartSec=3
SyslogIdentifier=matrix-synapse-%i

View file

@ -6,11 +6,11 @@ worker_name: "${WORKER_NAME:?}"
# The replication listener on the main synapse process.
worker_replication_host: "${WORKER_REPLICATION_HOST:?}"
worker_replication_http_port: "${WORKER_REPLICATION_PORT:?}"
worker_replication_http_port: ${WORKER_REPLICATION_PORT:?}
worker_listeners:
- type: http
port: "${WORKER_PORT:?}"
port: ${WORKER_PORT:?}
resources:
- names:
EOF

View file

@ -0,0 +1,12 @@
#!/bin/sh
# Designed for Debian/systemd - make sure to adapt when you add support for other
# distributions/OSs.
name=$__object_id
synapse_conf_dir='/etc/matrix-synapse'
synapse_workers_conf_dir="$synapse_conf_dir/workers"
systemd_worker_service="matrix-synapse-worker@$name"
if grep -qE "^__file$synapse_workers_conf_dir/$name" "${__messages_in}"; then
echo "systemctl restart $systemd_worker_service"
fi

View file

@ -8,7 +8,7 @@ os=$(cat "$__global/explorer/os")
case "$os" in
debian)
synapse_conf_dir='/etc/synapse'
synapse_conf_dir='/etc/matrix-synapse'
synapse_workers_conf_dir="$synapse_conf_dir/workers"
# Synapse log configuration on debian - default value of config-log
@ -53,14 +53,15 @@ require="__directory/$synapse_workers_conf_dir" \
--source "$__object/files/worker.yaml" \
--mode 0644
__file "/etc/systemd/systemd/matrix-synapse-worker@.service" \
__file "/etc/systemd/system/matrix-synapse-worker@.service" \
--source "$__type/files/matrix-synapse-worker@.service" \
--mode 0644 \
--state $systemd_worker_service_override
# Start service, enable at boot.
require="__file/$synapse_workers_conf_dir/$name.yaml \
__file/etc/systemd/systemd/matrix-synapse-worker@.service" \
__service "$systemd_worker_service" --action start
require="__service/$systemd_worker_service" \
service_req=
if [ "$systemd_worker_service_override" ]; then
service_req="__file/etc/systemd/system/matrix-synapse-worker@.service"
fi
require="__file/$synapse_workers_conf_dir/$name.yaml $service_req" \
__start_on_boot "$systemd_worker_service"

View file

@ -1,3 +1,2 @@
app
name
port