disk_block/disk-block.service

18 lines
732 B
Desktop File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[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/