Matrix Docker Ansible eploy
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

36 строки
1.2 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. # Instantiable worker service, running inside the synapse container
  3. # alongside the homeserver main process.
  4. # c.f. https://github.com/matrix-org/synapse/pull/4662
  5. [Unit]
  6. Description=Synapse Matrix Worker
  7. AssertPathExists={{matrix_synapse_config_dir_path }}/worker.%i.yaml
  8. After=matrix-synapse.service
  9. BindsTo=matrix-synapse.service
  10. [Service]
  11. Type=simple
  12. # Intentional delay, so that the homeserver (we likely depend on) can manage to start.
  13. ExecStartPre=/bin/sleep 5
  14. # no sane way of instancing more than one variable (systemd "cant-fix" 🤦)
  15. # c.f. https://github.com/systemd/systemd/issues/14895#issuecomment-594123923
  16. # So use good ol' shell parameter expansion to get the worker type..
  17. ExecStart=/bin/sh -c "WORKER=%i; WORKER=$${WORKER%%:*}; \
  18. exec /usr/bin/docker exec \
  19. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  20. matrix-synapse \
  21. python -m synapse.app.$${WORKER} -c /data/homeserver.yaml -c /data/worker.%i.yaml"
  22. ExecReload=/bin/kill -HUP $MAINPID
  23. ExecStop=/usr/bin/docker exec matrix-synapse pkill -f %i
  24. PIDFile=/matrix-run/{{ item.worker }}.port{{ item.port }}.pid
  25. KillMode=process
  26. Restart=always
  27. RestartSec=10
  28. SyslogIdentifier=matrix-synapse-%i
  29. [Install]
  30. WantedBy=matrix-synapse.service