SickGear/init-scripts/init.systemd

57 lines
2.1 KiB
Text
Executable file

# SickGear systemd service unit file
#
# Configuration Notes
#
# - Option names (e.g. ExecStart=, Type=) are case-sensitive)
#
# - Adjust User= and Group= to the user/group you want SickGear to run as.
#
# - Optional adjust EnvironmentFile= path to configuration file
# Can ONLY be used for configuring extra options used in ExecStart.
# Putting a minus (-) in front of file means no error warning if the file doesn't exist
#
# - Adjust ExecStart= to point to your python and SickGear executables.
# The FIRST token of the command line must be an ABSOLUTE FILE NAME,
# then followed by arguments for the process.
# If no --datadir is given, data is stored in same dir as SickBeard.py
# Arguments can also be set in EnvironmentFile (except python)
#
# - WantedBy= specifies which target (i.e. runlevel) to start SickGear for.
# multi-user.target equates to runlevel 3 (multi-user text mode)
# graphical.target equates to runlevel 5 (multi-user X11 graphical mode)
#
### Example Using SickGear as daemon with pid file
# Type=forking
# PIDFile=/var/run/sickgear/sickgear.pid
# ExecStart=/usr/bin/python2 /opt/sickgear/app/SickBeard.py -q --daemon --nolaunch --pidfile=/var/run/sickgear/sickgear.pid --datadir=/opt/sickgear/data
## Example Using SickGear as daemon without pid file
# Type=forking
# GuessMainPID=no
# ExecStart=/usr/bin/python2 /opt/sickgear/app/SickBeard.py -q --daemon --nolaunch --datadir=/opt/sickgear/data
### Example Using simple
# Type=simple
# ExecStart=/usr/bin/python2 /opt/sickgear/app/SickBeard.py -q --nolaunch
### Example Using simple with EnvironmentFile where SB_DATA=/home/sickgear/.sickgear in /etc/sickgear.conf
# Type=simple
# EnvironmentFile=/etc/sickgear.conf
# ExecStart=/usr/bin/python2 /opt/sickgear/app/SickBeard.py -q --nolaunch --datadir=${SB_DATA}
### Configuration
[Unit]
Description=SickGear Daemon
[Service]
User=sickgear
Group=sickgear
Type=forking
GuessMainPID=no
ExecStart=/usr/bin/python2 /opt/sickgear/app/SickBeard.py -q --daemon --nolaunch --datadir=/opt/sickgear/data
[Install]
WantedBy=multi-user.target