将脚本的符号链接添加到 rc.d 文件夹中,以在系统启动期间启动进程

发布于 2024-12-27 04:13:13 字数 1459 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执着的年纪 2025-01-03 04:13:13

RC 脚本的命名约定如下

  • 对于 /etc/init.d 中的任何启动脚本 S##<基本脚本名称>
  • 终止脚本 K, ##<基本脚本名称>

## 表示运行级别控制脚本运行期间脚本的执行顺序。脚本执行的顺序是:

  • 终止脚本
  • 启动脚本

执行的顺序与输出中文件的顺序相同:

`ls /etc/rc#.d/K*`
`ls /etc/rc#.d/S*`

因此,K15httpd 的存在脚本意味着在您的情况 5 的这个运行级别,apache(或其他 Web 服务)应该停止。

出于同样的原因,较低级别的 MySQL 的终止脚本将是 K02MySQL

你可以看看这个链接以了解有关编写 System V 初始化脚本的信息。

The naming convention for the RC scripts is as follows for any in /etc/init.d

  • Start scripts S##<base script name>
  • Kill scripts K##<base script name>

The ## represent the order in which the script will be executed during the run of runlevel control script. The order in which the scripts are executed is:

  • Kill scripts
  • Start Scripts

The order in which it will be execute is the same as the order of files in the output of:

`ls /etc/rc#.d/K*`
`ls /etc/rc#.d/S*`

So by this token the existence of K15httpd script implies that at this runlevel in your case 5 the apache(or another web service) should be stopped.

By same token the kill script for MySQL in lower levels then the one you start it in would be K02MySQL.

You can look at this link to read about the writing the System V init scripts.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文