mirror of
https://github.com/msfjarvis/server-config
synced 2025-08-14 08:17:01 +05:30
systemd: Sync pyrobud unit with recommended settings
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
This commit is contained in:
parent
c9b2bf0ad8
commit
cf54c33870
1 changed files with 26 additions and 11 deletions
|
@ -1,20 +1,35 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Pyrobud Telegram userbot service
|
Description=Pyrobud Telegram selfbot
|
||||||
After=network.target
|
After=multi-user.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Restart=on-abort
|
# Base settings
|
||||||
Type=simple
|
Type=simple
|
||||||
User=bot
|
Restart=always
|
||||||
WorkingDirectory=/home/bot/pyrobud
|
RestartSec=10
|
||||||
ExecStart=/home/bot/pyrobud/venv/bin/python main.py
|
|
||||||
ExecReload=/bin/kill -USR1 $MAINPID
|
# Execution parameters
|
||||||
KillMode=mixed
|
User=pyrobud
|
||||||
KillSignal=SIGQUIT
|
Group=pyrobud
|
||||||
TimeoutStopSec=5s
|
WorkingDirectory=/home/pyrobud/pyrobud
|
||||||
|
ExecStart=/home/pyrobud/venv/bin/python -O /home/pyrobud/pyrobud/main.py
|
||||||
|
|
||||||
|
# Limit damage in case something goes awry
|
||||||
|
MemoryLimit=256M
|
||||||
|
CPUQuota=200%
|
||||||
|
|
||||||
|
# Security
|
||||||
PrivateTmp=true
|
PrivateTmp=true
|
||||||
PrivateDevices=false
|
|
||||||
ProtectSystem=full
|
ProtectSystem=full
|
||||||
|
NoNewPrivileges=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
PrivateDevices=true
|
||||||
|
RestrictAddressFamilies=AF_INET AF_INET6
|
||||||
|
RestrictNamespaces=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue