// Aula 6 - Adicionando novos serviços ao systemd # vim test.py3 #!/usr/bin/python3 import time def your_function(): print("Hello, World") while True: your_function() time.sleep(10) # python3 test.py3 vim /etc/systemd/system/test.service [Unit] Description=Python test After=network-online.target Wants=network-online.target systemd-networkd-wait-online.service [Service] Type=simple Restart=on-failure RestartSec=5s User=root ExecStart=/usr/bin/python3 /root/test.py3 [Install] WantedBy=multi-user.target $ systemctl start test # systemctl status test # systemctl enable test After=mysqld.service Restart=always RestartSec=1 StartLimitBurst=5 StartLimitIntervalSec=10 StartLimitAction=reboot