1、进入etc/init.d
创建test.sh编辑
本例子,主要,开机创建opt/test文件。
#!/bin/sh
### BEGIN INIT INFO
# Provides: start_test.sh
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the start_test.sh
# Description: starts start_test.sh
# for security.
### END INIT INFO
mkdir /opt/test
2、sudo chmod +x test.sh
sudo update-rc.d start_test.sh defaults 90