mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 10:03:40 +01:00
Add comments to the sample service file
This commit is contained in:
parent
9324d8996e
commit
1a3e6bb104
2 changed files with 11 additions and 1 deletions
|
@ -632,6 +632,7 @@ class OtherCog(commands.Cog):
|
||||||
|
|
||||||
async def dns_check() -> Optional[bool | str]:
|
async def dns_check() -> Optional[bool | str]:
|
||||||
try:
|
try:
|
||||||
|
# noinspection PyTypeChecker
|
||||||
for response in await asyncio.to_thread(dns.resolver.resolve, url.hostname, "A"):
|
for response in await asyncio.to_thread(dns.resolver.resolve, url.hostname, "A"):
|
||||||
if response.address == "0.0.0.0":
|
if response.address == "0.0.0.0":
|
||||||
return "DNS blacklist"
|
return "DNS blacklist"
|
||||||
|
|
|
@ -4,17 +4,26 @@ StartLimitBurst=10
|
||||||
# If we're still failing after 10 attempts, something is wrong.
|
# If we're still failing after 10 attempts, something is wrong.
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
After=network.target network-online.target
|
After=network.target network-online.target
|
||||||
|
# Wait until a network connection is established
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
RemainAfterExit=no
|
RemainAfterExit=no
|
||||||
ExecStart=/home/nex/jimmy/venv/bin/python3 /home/nex/jimmy/main.py
|
ExecStart=/home/nex/jimmy/venv/bin/python3 /home/nex/jimmy/main.py
|
||||||
|
# Change the path to where your binaries are
|
||||||
|
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
# Wait 5 seconds before restarts
|
# Wait 5 seconds before restarts.
|
||||||
|
|
||||||
User=nex
|
User=nex
|
||||||
|
# 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)
|
||||||
|
|
||||||
MemoryMax=1024M
|
MemoryMax=1024M
|
||||||
CPUQuota=50%
|
CPUQuota=50%
|
||||||
|
# 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).
|
||||||
|
|
||||||
# Security so that people like @Mcharlsto can't delete my system "by accident"
|
# Security so that people like @Mcharlsto can't delete my system "by accident"
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
|
|
Loading…
Reference in a new issue