forked from tgorgdotcom/locast2plex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocast2plex.service
21 lines (19 loc) · 1.05 KB
/
locast2plex.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Systemctl file for locast2plex running on a CentOS 7 system
# Assumes the application is living in /opt/locast2.plex and a user and group locast2plex
# "yum install daemonize" if you do not have that package already installed
# You also need to install python 3.6 from the SCLo packages
# Written by Warren Melnick, warrenmelnick -at- gmail -dot- com, 2020-12-31
[Unit]
Description=locast2plex background service
After=network.target
[Service]
WorkingDirectory=/opt/locast2plex
ExecStartPre=/usr/bin/touch /var/log/locast2plex.log
ExecStartPre=/usr/bin/chown locast2plex:locast2plex /var/log/locast2plex.log
ExecStartPre=/usr/bin/mkdir -p /var/run/locast2plex
ExecStartPre=/usr/bin/chown -R locast2plex:locast2plex /var/run/locast2plex
ExecStart=/usr/sbin/daemonize -u locast2plex -c /opt/locast2plex -a -o /var/log/locast2plex.log -e /var/log/locast2plex.log -p /var/run/locast2plex/locast2plex.pid -l /var/run/locast2plex/locast2plex.lock /usr/bin/python3 main.py
ExecStop=/usr/bin/kill $(echo /var/run/locast2plex.pid)
Type=forking
[Install]
WantedBy=multi-user.target