[Unit]
Description=Matrix Homeserver
Requires=matrix-keyserver.service matrix-sydent.service 
After=postgresql.service

[Service]
#Type=notify
Type=forking
NotifyAccess=main
ExecReload=/bin/kill -HUP $MAINPID
Restart=on-abort
User=synapse
Group=matrix
WorkingDirectory=/opt/matrix
ExecStart=/opt/matrix/synapse/synapse-venv/bin/synctl start /etc/matrix-synapse/homeserver.yaml
ExecStop=/opt/matrix/synapse/synapse-venv/bin/synctl stop
SyslogIdentifier=synapse
RuntimeDirectory=matrix

# Environment=SYNAPSE_CACHE_FACTOR=2.0

[Install]
WantedBy=multi-user.target