创建启动脚本
如/usr/sbin/hikcam.sh
里面写要开机执行的命令
chmod 777 赋予权限
/lib/systemd/system下创建 .service文件
[Unit]
Description="bringup hikcam"
After=network.target[Service]
Environment=LD_LIBRARY_PATH=/opt/MVS/lib/aarch64
Type=simple
ExecStart=/usr/sbin/hikcam.sh[Install]
WantedBy=multi-user.target
修改配置文件后需要重加载配置
sudo systemctl daemon-reload
开机自启动 systemctl enable test.service