server-config/systemd_units/mirror-bot-2.service
Harsh Shandilya 9a506ec776
systemd: Cap resource usage for all services
Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
2019-09-10 20:59:04 +05:30

25 lines
473 B
Desktop File

[Unit]
Description=Private mirror bot service
After=network.target
[Service]
Restart=on-abort
Type=simple
User=bot
WorkingDirectory=/home/bot/aria-telegram-mirror-bot-2
ExecStartPre=/usr/bin/env bash aria.sh
ExecStart=/usr/bin/npm start
ExecReload=/bin/kill -USR1 $MAINPID
KillMode=mixed
KillSignal=SIGQUIT
TimeoutStopSec=5s
PrivateTmp=true
PrivateDevices=true
ProtectSystem=full
CPUWeight=10
CPUQuota=10%
IOWeight=20
MemorySwapMax=0
[Install]
WantedBy=multi-user.target