Add daemon-izing files

This commit is contained in:
Riley Housden 2021-11-30 01:42:44 -05:00
parent cc9e93fa6c
commit 6f88e1f209
Signed by: InValidFire
GPG key ID: 0D6208F6DF56B4D8
3 changed files with 21 additions and 13 deletions

6
install Executable file
View file

@ -0,0 +1,6 @@
adduser --system --home /otp/radical-api radical-api
cp * /otp/radical-api
cp radical-api.service /etc/systemd/system
addgroup --system radical-api
adduser radical-api radical-api
systemd enable radical-api

15
radical-api.service Normal file
View file

@ -0,0 +1,15 @@
[Unit]
Description=Radical API Daemon
After=network.target
StartLimitIntervalSec=0
[Service]
WorkingDirectory=/otp/radical-api
User=radical-api
Group=radical-api
Restart=on-failure
RestartSec=20 3
ExecStart=/usr/bin/env python /otp/radical-api/main.py
[Install]
WantedBy=multi.user.target

View file

@ -1,13 +0,0 @@
[Unit]
Description=API for my habit tracking system.
After=network.target
StartLimitIntervalSec=0
# need to setup custom user for api.
[Service]
Type=simple
Restart=always
RestartSec=1
User=
ExecStart=/usr/bin/env python main.py