locast2plex
locast2plex copied to clipboard
Systemd Service?
Anyone have this running as service on ubuntu? Here's what I came up with so far. I used an environment file because I couldn't figure out a way to pass the arguments in the ExecStart value.
service file
[Unit]
Description=Locast2Plex Service
After=network-online.target
[Service]
EnvironmentFile=/etc/.locast2plex
WorkingDirectory=/opt/locast2plex
ExecStart=/usr/bin/python /opt/locast2plex/main.py $ARG1 $ARG2 $ARG3
GuessMainPID=no
Type=Simple
User=plex
Group=plex
Restart=always
RestartSec=5
StartLimitInterval=90
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
environment file
ARG1=-u:username
ARG2=-p:password
ARG3=--addy:127.0.0.1
honest question: why not run it in docker if you are already on linux? also keeps you from having python 2.7 around if you don't want to