【教程】CentOS 设置开机自启动脚本

版权声明:感谢观看! https://blog.csdn.net/qq153471503/article/details/83507105

《CentOS 设置开机自启动脚本》


  1. 新建脚本文件autorun.sh
#!/bin/sh
#chkconfig:2345 85 15
​#description: test

echo "Hello Linux !!"

注意:#chkconfig和​#description必须添加,要不然chkconfig报错

  1. 给autorun.sh添加可执行权限:
    chmod +x autorun.sh
  2. 将autorun.sh移动到/etc/init.d/目录下
  3. chkconfig --add autorun.sh
  4. chkconfig --level 2345 autorun.sh on

end…

猜你喜欢

转载自blog.csdn.net/qq153471503/article/details/83507105
今日推荐