2018-12-04 08:03:58 -08:00
|
|
|
# Varken - Command-line utility to aggregate data from the Plex ecosystem into InfluxDB.
|
|
|
|
#
|
|
|
|
# Service Unit file for systemd system manager
|
|
|
|
#
|
|
|
|
# INSTALLATION NOTES
|
|
|
|
#
|
|
|
|
# 1. Copy this file into your systemd service unit directory (often '/lib/systemd/system')
|
|
|
|
# and name it 'varken.service' with the following command:
|
|
|
|
# cp /opt/Varken/Varken/varken.systemd /lib/systemd/system/varken.service
|
|
|
|
#
|
|
|
|
# 2. Edit the new varken.service file with configuration settings as required.
|
|
|
|
# More details in the "CONFIGURATION NOTES" section shown below.
|
|
|
|
#
|
|
|
|
# 3. Enable boot-time autostart with the following commands:
|
|
|
|
# systemctl daemon-reload
|
|
|
|
# systemctl enable varken.service
|
|
|
|
#
|
|
|
|
# 4. Start now with the following command:
|
|
|
|
# systemctl start varken.service
|
|
|
|
#
|
|
|
|
# CONFIGURATION NOTES
|
|
|
|
#
|
|
|
|
# - The example settings in this file assume that you will run varken as user: varken
|
|
|
|
# - The example settings in this file assume that varken is installed to: /opt/Varken
|
|
|
|
#
|
|
|
|
# - To create this user and give it ownership of the Varken directory:
|
|
|
|
# Ubuntu/Debian: sudo addgroup varken && sudo adduser --system --no-create-home varken --ingroup varken
|
|
|
|
# CentOS/Fedora: sudo adduser --system --no-create-home varken
|
|
|
|
# sudo chown varken:varken -R /opt/Varken
|
|
|
|
#
|
|
|
|
# - Adjust User= and Group= to the user/group you want Varken to run as.
|
|
|
|
#
|
|
|
|
# - WantedBy= specifies which target (i.e. runlevel) to start Varken for.
|
|
|
|
# multi-user.target equates to runlevel 3 (multi-user text mode)
|
|
|
|
# graphical.target equates to runlevel 5 (multi-user X11 graphical mode)
|
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=Varken - A data collection and graphing tool
|
|
|
|
After=network-online.target
|
2018-12-04 08:32:55 -08:00
|
|
|
StartLimitInterval=200
|
|
|
|
StartLimitBurst=3
|
2018-12-04 08:03:58 -08:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
2018-12-04 08:32:55 -08:00
|
|
|
User=varken
|
|
|
|
Group=varken
|
2018-12-04 08:03:58 -08:00
|
|
|
WorkingDirectory=/opt/Varken
|
|
|
|
ExecStart=/opt/Varken/varken-venv/bin/python /opt/Varken/varken.py
|
2018-12-04 08:32:55 -08:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2018-12-04 08:03:58 -08:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|