1

新贵文档状态(指pre-stop节):

您也可以使用此节来取消停止,类似于在开始前取消开始的方式。

[资源]

取消pre-start节中开始的示例是:

pre-start script

  # stop job from continuing if no config file found for daemon
  [ ! -f /etc/default/myapp ] && { stop; exit 0; }

  # source the config file
  . /etc/default/myapp

  # stop job from continuing if admin has not enabled service in
  # config file.
  [ -z "$ENABLED" ] && { stop; exit 0; }

end script

[资源]

这是有道理的,因为它将退出脚本。但是,exitpre-stop节中执行 an 也会退出脚本,而不是取消停止。那准确吗?您如何使用该pre-stop节来实际取消stop

4

1 回答 1

1

You can use the start keyword instead of the stop. This will put the job back in the start/running state from the start/pre-stop state.

pre-stop script
    start
end script
于 2014-07-21T11:13:23.730 回答