将可执行程序添加为 linux 系统服务

[Unit]
Description=Unitree Z1 Controller Service
After=network.target

[Service]
Type=simple
User=khadas
Restart=on-failure
RemainAfterExit=yes
RestartSec=5s
ExecStart=/bin/bash -c "cd /home/unitree/z1-controller/build; ./z1_ctrl"

[Install]
WantedBy=multi-user.target

你可能感兴趣的:(编程开发,Ubuntu,c++,ubuntu)