CentOS添加开机启动脚本

  • 在/etc/init.d/目录创建startup-test文件

    1
    2
    3
    4
    #!/bin/bash
    # chkconfig: 2345 10 90

    echo `date` ~/startup-success.log
  • 添加到开机启动

    1
    chkconfig --add startup-test

提示:需要注意添加 #chkconfig: 2345 10 90 注释