Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

Commit

Permalink
Adds systemD to monitor proccess
Browse files Browse the repository at this point in the history
  • Loading branch information
Pete Maynard committed Dec 13, 2016
1 parent cde460e commit 577f731
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
22 changes: 15 additions & 7 deletions roles/synapse/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,24 @@
# TODO: Deploy the config template using vault to store the secrets.
# - Port 8448 listen should be bound to localhost
# - x_forwarded: true
# TODO: Systemd service for synapse

- name: Start synapse
command: bin/synctl start
args:
chdir: ~/.synapse


# - name: Create directories needed
# file:
# path: ~/.config/systemd/user/
# state: directory
# mode: 0755
become: yes
become_user: synapse

- name: SystemD Service
template: src=synapse.service dest=/etc/systemd/system/synapse.service

- name: Enabling Service
command: systemctl enable synapse.service

- name: Start synapse
command: service synapse start

- name: Enable nginx reverse proxy
blockinfile:
dest: /etc/nginx/sites-available/matrix.ac
Expand Down
14 changes: 14 additions & 0 deletions roles/synapse/templates/synapse.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Synapse Matrix Homeserver

[Service]
Type=forking
PIDFile=/home/synapse/.synapse/homeserver.pid
User=synapse
Group=synapse
Restart=on-failure
WorkingDirectory=/home/synapse/.synapse/
ExecStart=/home/synapse/.synapse/bin/synctl start

[Install]
WantedBy=multi-user.target

0 comments on commit 577f731

Please sign in to comment.