创建systemd service服务
创建服务
1.创建服务文件
vi /etc/systemd/system/my_service.service2.编写服务文件
[Unit]
Description=My Custom Service
After=network.target
[Service]
Type=simple
ExecStart= /usr/bin/python3 /path/to/your/script.py
Restart=always
[Install]
WantedBy=multi-user.target