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
This commit is contained in:
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", "version": "0.1.0",
"description": "Puppeteer module for matrix-puppeteer-line", "description": "Chrome/Puppeteer backend for matrix-puppeteer-line",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://src.miscworks.net/fair/matrix-puppeteer-line.git" "url": "git+https://src.miscworks.net/fair/matrix-puppeteer-line.git"

View File

@ -1,15 +1,18 @@
[Unit] [Unit]
Description=Matrix-puppeteer-line Chrome backend Description=Chrome/Puppeteer backend for matrix-puppeteer-line
PartOf=matrix-puppeteer-line-chrome.target After=multi-user.target network.target
[Service] [Service]
; User=matrix-line ; User=matrix-puppeteer-line
; Group=matrix ; Group=matrix-puppeteer-line
Type=notify Type=notify
NotifyAccess=all NotifyAccess=all
WorkingDirectory=/opt/synapse/bridges/matrix-puppeteer-line/puppet WorkingDirectory=/opt/matrix-puppeteer-line/puppet
ExecStart=/bin/xvfb-run /usr/bin/node src/main.js ConfigurationDirectory=matrix-puppeteer-line
RuntimeDirectory=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] [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] [Unit]
Description=Matrix-puppeteer-line bridge Description=matrix-puppeteer-line bridge
BindsTo=matrix-puppeteer-line-chrome.target BindsTo=matrix-puppeteer-line-chrome.service
After=matrix-puppeteer-line-chrome.target PartOf=matrix-puppeteer-line-chrome.service
After=matrix-puppeteer-line-chrome.service
[Service] [Service]
; User=matrix-line ; User=matrix-puppeteer-line
; Group=matrix ; Group=matrix-puppeteer-line
WorkingDirectory=/opt/synapse/bridges/matrix-puppeteer-line WorkingDirectory=/opt/matrix-puppeteer-line
ExecStart=/opt/synapse/bridges/matrix-puppeteer-line/.venv/bin/python -m matrix_puppeteer_line ConfigurationDirectory=matrix-puppeteer-line
RuntimeDirectory=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] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target