2023-03-20 15:03:24 +00:00
|
|
|
[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
|
2023-04-18 16:58:18 +01:00
|
|
|
# Wait until a network connection is established
|
2023-03-20 15:03:24 +00:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
|
|
|
RemainAfterExit=no
|
|
|
|
ExecStart=/home/nex/jimmy/venv/bin/python3 /home/nex/jimmy/main.py
|
2023-04-18 16:58:18 +01:00
|
|
|
# Change the path to where your binaries are
|
|
|
|
|
2023-03-20 15:03:24 +00:00
|
|
|
Restart=always
|
|
|
|
RestartSec=5
|
2023-04-18 16:58:18 +01:00
|
|
|
# Wait 5 seconds before restarts.
|
|
|
|
|
2023-03-20 15:03:24 +00:00
|
|
|
User=nex
|
2023-04-18 16:58:18 +01:00
|
|
|
# Change `nex` to whatever user to run as (NOT root, for the love of god don't run my software as root unless
|
|
|
|
# the program specifically asks for it)
|
|
|
|
|
2023-03-20 15:03:24 +00:00
|
|
|
MemoryMax=1024M
|
|
|
|
CPUQuota=50%
|
2023-04-18 16:58:18 +01:00
|
|
|
# Realistically, the bot will never need more than a gigabyte of RAM and half a CPU core.
|
|
|
|
# However, some features (namely /screenshot) can use an uncontrollable amount of resources (e.g. a browser).
|
2023-03-20 15:03:24 +00:00
|
|
|
|
|
|
|
# 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
|