新建服务文件 1 sudo nano /usr/lib/systemd/system/xx_net.service 1 2 3 4 5 6 7 8 9 10 11 12 13 [Unit] Description=xx_net [Service] Type=oneshot ExecStart=/home/pi/Desktop/XX-Net/start [Install] WantedBy=multi-user.target 指定服务自启动 1 sudo systemctl enable xx_net.service