Add sample service file

Signed-off-by: nex <me@nexy7574.co.uk>
This commit is contained in:
Nexus 2023-03-20 15:03:24 +00:00
parent 7bcc441d38
commit a0680b907f
Signed by: nex
GPG key ID: 0FA334385D0B689F

26
college-bot.service Normal file
View file

@ -0,0 +1,26 @@
[Unit]
Description=LCC Bot
StartLimitBurst=10
# If we're still failing after 10 attempts, something is wrong.
Wants=network-online.target
After=network.target network-online.target
[Service]
Type=simple
RemainAfterExit=no
ExecStart=/home/nex/jimmy/venv/bin/python3 /home/nex/jimmy/main.py
Restart=always
RestartSec=5
# Wait 5 seconds before restarts
User=nex
MemoryMax=1024M
CPUQuota=50%
# Security so that people like @Mcharlsto can't delete my system "by accident"
PrivateTmp=true
PrivateDevices=true
ProtectSystem=true
ProtectHome=true
[Install]
WantedBy=multi-user.target