Tweak systemd units

Changes include:
* Remove target unit
* Create and use config directory
* Use directory directly under /opt as home
* Rename suggested user/group
* Restart on failure
* (aside) Rename Node module name after Chrome unit
pull/27/head
Andrew Ferrazzutti 2021-07-14 01:36:15 -04:00
parent b7734aa9ba
commit d5cd9fe8b9
4 changed files with 26 additions and 24 deletions

View File

@ -1,7 +1,7 @@
{
"name": "matrix-puppeteer-line-puppeteer",
"name": "matrix-puppeteer-line-chrome",
"version": "0.1.0",
"description": "Puppeteer module for matrix-puppeteer-line",
"description": "Chrome/Puppeteer backend for matrix-puppeteer-line",
"repository": {
"type": "git",
"url": "git+https://src.miscworks.net/fair/matrix-puppeteer-line.git"

View File

@ -1,15 +1,18 @@
[Unit]
Description=Matrix-puppeteer-line Chrome backend
PartOf=matrix-puppeteer-line-chrome.target
Description=Chrome/Puppeteer backend for matrix-puppeteer-line
After=multi-user.target network.target
[Service]
; User=matrix-line
; Group=matrix
; User=matrix-puppeteer-line
; Group=matrix-puppeteer-line
Type=notify
NotifyAccess=all
WorkingDirectory=/opt/synapse/bridges/matrix-puppeteer-line/puppet
ExecStart=/bin/xvfb-run /usr/bin/node src/main.js
RuntimeDirectory=matrix/puppeteer-line
WorkingDirectory=/opt/matrix-puppeteer-line/puppet
ConfigurationDirectory=matrix-puppeteer-line
RuntimeDirectory=matrix-puppeteer-line
ExecStart=/usr/bin/xvfb-run -a yarn start --config ${CONFIGURATION_DIRECTORY}/puppet-config.json
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@ -1,5 +0,0 @@
[Unit]
Description=Matrix puppeteer line bridge target
Requires=multi-user.target network.target
After=multi-user.target network.target
BindsTo=matrix-puppeteer-line-chrome.service

View File

@ -1,14 +1,18 @@
[Unit]
Description=Matrix-puppeteer-line bridge
BindsTo=matrix-puppeteer-line-chrome.target
After=matrix-puppeteer-line-chrome.target
Description=matrix-puppeteer-line bridge
BindsTo=matrix-puppeteer-line-chrome.service
PartOf=matrix-puppeteer-line-chrome.service
After=matrix-puppeteer-line-chrome.service
[Service]
; User=matrix-line
; Group=matrix
WorkingDirectory=/opt/synapse/bridges/matrix-puppeteer-line
ExecStart=/opt/synapse/bridges/matrix-puppeteer-line/.venv/bin/python -m matrix_puppeteer_line
RuntimeDirectory=matrix/puppeteer-line
; User=matrix-puppeteer-line
; Group=matrix-puppeteer-line
WorkingDirectory=/opt/matrix-puppeteer-line
ConfigurationDirectory=matrix-puppeteer-line
RuntimeDirectory=matrix-puppeteer-line
ExecStart=/opt/matrix-puppeteer-line/.venv/bin/python -m matrix_puppeteer_line -c ${CONFIGURATION_DIRECTORY}/config.yaml
Restart=on-failure
RestartSec=3
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target