linux设置开机启动 服务不支持chkconfig解决方法脚本

 写了脚本,想用命令chkconfig加载自启动.提示"**服务不支持chkconfig",原来是自己写的脚本时,忘记写两行了.开头一般要这样写

  #!/bin/bash
  #chkconfig:345 61 61 //此行的345参数表示,在哪些运行级别启动,启动序号(S61);关闭序号(K61)
  #description:Apache //此行必写,描述服务.

  把脚本拷贝至/etc/init.d/目录下,执行命令:
  #ln -s /etc/init.d/
  #ln -s /etc/init.d/
  #ln -s /etc/init.d/

  再执行
  #chkconfig --levels httpd 345 on

猜你喜欢

转载自blog.csdn.net/weixin_42350212/article/details/81012886
今日推荐