Template the systemd file

This commit is contained in:
Emmanouil Kampitakis 2019-02-21 23:16:22 +01:00
parent f6e9b7ce22
commit 82e1d23527
3 changed files with 18 additions and 18 deletions

View file

@ -1,16 +0,0 @@
[Unit]
Description="Matrix Synapse Server (synapse)"
[Service]
Type=simple
WorkingDirectory=/opt/synapse
ExecStart=/opt/synapse/env/bin/python -m synapse.app.homeserver --config-path=/opt/synapse/homeserver.yaml --log-config=/opt/synapse/log.config
ExecStop=/opt/synapse/env/bin/synctl stop /opt/synapse/homeserver.yaml
User=synapse
Group=synapse
Restart=always
StandardOutput=syslog
SyslogIdentifier=matrix_synapse
[Install]
WantedBy=default.target

View file

@ -1,7 +1,7 @@
---
- name: Deploy service file
copy:
src: "matrix-synapse.service"
template:
src: "matrix-synapse.service.j2"
dest: "/etc/systemd/system/matrix-synapse.service"
notify:
- "reload systemd"

View file

@ -0,0 +1,16 @@
[Unit]
Description="Matrix Synapse Server (synapse)"
[Service]
Type=simple
WorkingDirectory={{ matrix_synapse_base_path }}
ExecStart={{ matrix_synapse_base_path }}/env/bin/python -m synapse.app.homeserver --config-path={{ matrix_synapse_base_path }}/homeserver.yaml --log-config={{ matrix_synapse_base_path }}/log.config
ExecStop={{ matrix_synapse_base_path }}/env/bin/synctl stop {{ matrix_synapse_base_path }}/homeserver.yaml
User=synapse
Group=synapse
Restart=always
StandardOutput=syslog
SyslogIdentifier=matrix_synapse
[Install]
WantedBy=default.target