Debian 10 创建开机自启动脚本 发表于 2020-08-24 分类于 实用教程 Waline: 阅读次数: 使用update-rc.d添加开机自启动脚本 1234567891011## 进入开机启动目录cd /etc/init.d## 创建开机启动脚本touch xx.sh## 赋予执行权限chmod +x /etc/init.d/xx.sh#设置开机自启update-rc.d xx.sh defaults 可能会报错,缺少必填项 1234insserv: warning: script 'xx.sh' missing LSB tagsinsserv: warning: script 'xx.sh' missing LSB tagsinsserv: Default-Start undefined, assuming empty start runlevel(s) for script `xx.sh'insserv: Default-Stop undefined, assuming empty stop runlevel(s) for script `xx.sh' 在脚本最前面添加必填项,参数说明:LSBInitScripts 12345678910#!/bin/sh### BEGIN INIT INFO# Provides: xx# Required-Start: $all# Required-Stop: $all# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: starts xx# Description: starts the xx### END INIT INFO