[ADD] add service unit for linux
This commit is contained in:
parent
12c0563e36
commit
c95896e94d
18
disk-block.service
Normal file
18
disk-block.service
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Disk Blocking utility
|
||||||
|
After=mnt-wibble.mount #start after mount service
|
||||||
|
StartLimitIntervalSec=0
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
Restart=always # перезапуск всегда
|
||||||
|
RestartSec=60 # интервал между перезапусками
|
||||||
|
User=root # пользователь от имени, которого запускается скрипт
|
||||||
|
WorkingDirectory=/root/disk_block
|
||||||
|
ExecStart=/root/disk_block/venv/bin/python /root/disk_block/main.py #тут путь до выполяемого скрипта с путем до бинарника питона
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
# кладешь этот юнит в /etc/systemd/system
|
||||||
|
# https://habr.com/ru/companies/slurm/articles/255845/
|
||||||
Loading…
x
Reference in New Issue
Block a user