Matrix Docker Ansible eploy
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 

40 Zeilen
1.4 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=Matrix worker synapse.app.%i
  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 can manage to start.
  13. ExecStartPre={{ matrix_host_command_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 {{ matrix_host_command_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. # wait for worker startup & write out PID of actual worker process so systemd can handle it
  23. ExecStartPost={{ matrix_host_command_sleep }} 5
  24. ExecStartPost={{ matrix_local_bin_path }}/matrix-synapse-worker-write-pid %i /run/matrix-synapse-worker.%i.pid
  25. ExecReload=/bin/kill -HUP $MAINPID
  26. ExecStop=/bin/kill $MAINPID
  27. PIDFile=/run/matrix-synapse-worker.%i.pid
  28. KillMode=process
  29. Restart=always
  30. RestartSec=10
  31. SyslogIdentifier=matrix-synapse-%i
  32. [Install]
  33. WantedBy=matrix-synapse.service