locast2plex icon indicating copy to clipboard operation
locast2plex copied to clipboard

Systemd Service?

Open m1lkman opened this issue 4 years ago • 1 comments

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

m1lkman avatar Aug 26 '20 22:08 m1lkman

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

ratherDashing avatar Aug 26 '20 23:08 ratherDashing