misc (systemd): Add `systemd` units:
Add units for ``systemd`` to easily handle Libervia services on system-wide installation. There is a service to run a single backend instance for all clients and components, and another one if administrators prefer isolated instances. The latter one uses a systemd template system.
This commit is contained in:
parent
995200a978
commit
8754c89d5b
4 changed files with 64 additions and 0 deletions
9
misc/systemd/README.md
Normal file
9
misc/systemd/README.md
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Libervia systemd units
|
||||
|
||||
Here you'll find [systemd](https://systemd.io/) units to run Libervia:
|
||||
|
||||
- `libervia-backend.service`: to be used when you run a single backend instance for all
|
||||
components and clients (or for the main instance).
|
||||
- `libervia@.service`: a template for isolated backend instances. To be used for a
|
||||
component, a dedicated backend for the web frontend, or any other isolated usage.
|
||||
- `libervia-web.service`: Libervia Web frontend.
|
||||
18
misc/systemd/libervia-backend.service
Normal file
18
misc/systemd/libervia-backend.service
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=Libervia Backend
|
||||
Wants=network-online.target
|
||||
After=network.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=libervia
|
||||
Group=libervia
|
||||
StateDirectory=libervia
|
||||
RuntimeDirectory=libervia
|
||||
Environment=XDG_RUNTIME_DIR=/run/libervia
|
||||
ExecStart=libervia-backend fg
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
18
misc/systemd/libervia-web.service
Normal file
18
misc/systemd/libervia-web.service
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[Unit]
|
||||
Description=Libervia Web
|
||||
Wants=network-online.target libervia-backend.service
|
||||
After=network.target network-online.target libervia-backend.service
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=libervia
|
||||
Group=libervia
|
||||
StateDirectory=libervia-web
|
||||
RuntimeDirectory=libervia-web
|
||||
Environment=XDG_RUNTIME_DIR=/run/libervia-web
|
||||
ExecStart=libervia-web fg
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
19
misc/systemd/libervia@.service
Normal file
19
misc/systemd/libervia@.service
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[Unit]
|
||||
Description=Libervia %i (isolated)
|
||||
Wants=network-online.target
|
||||
After=network.target network-online.target
|
||||
|
||||
[Service]
|
||||
Type=exec
|
||||
User=libervia
|
||||
Group=libervia
|
||||
StateDirectory=libervia
|
||||
RuntimeDirectory=libervia-%i
|
||||
Environment=XDG_RUNTIME_DIR=/run/libervia-%i
|
||||
Environment=LIBERVIA_ISOLATION=%i
|
||||
ExecStart=libervia-backend fg
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Reference in a new issue