1.創(chuàng)建spi_screen_app.service文件
/etc/systemd/system/spi_screen_app.service
內(nèi)容如下:
[Unit]
Description=spi_screen_app
After=network.target
[Service]
ExecStart=/root/software/spi_screen/spi_screen_app
WorkingDirectory=/root/software/spi_screen
User=root
Group=root
Restart=always
[Install]
WantedBy=multi-user.target
2.開啟
systemctl enable spi_screen_app
3.關(guān)閉
systemctl disable spi_screen_app