在服务器上添加启动脚本

时间:2012-06-22 09:28:05

标签: linux shell

我以root身份登录到我的服务器并尝试运行此命令:

# update-rc.d -f tk10xbooting.sh default 5

这里tk10xbooting.sh是我想在每次服务器重启时运行的脚本。但是当我运行它时,结果输出如下:

update-rc.d: using dependency based boot sequencing
usage: update-rc.d [-n] [-f] <basename> remove
       update-rc.d [-n] <basename> defaults [NN | SS KK]
       update-rc.d [-n] <basename> start|stop NN runlvl [runlvl] [...] .
       update-rc.d [-n] <basename> disable|enable [S|2|3|4|5]
        -n: not really
        -f: force

The disable|enable API is not stable and might change in the future.

知道发生了什么事吗?

1 个答案:

答案 0 :(得分:0)

updte-rc.d的语法(根据您提供的输出)与您提供的不同:

  • 您使用的默认值应为默认值 s
  • -f仅用于remove命令
  • 您可能需要使用05而不是5,因为语法告诉它应该是NN(但它可能会工作为5,我不知道)
相关问题