Add daemon-izing files
This commit is contained in:
parent
cc9e93fa6c
commit
6f88e1f209
3 changed files with 21 additions and 13 deletions
6
install
Executable file
6
install
Executable 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
15
radical-api.service
Normal 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
|
|
@ -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
|
||||
|
Loading…
Reference in a new issue