linux – 将脚本中的符号链接添加到rc.d文件夹中以在系统启动期间启动进程
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了linux – 将脚本中的符号链接添加到rc.d文件夹中以在系统启动期间启动进程,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1647字,纯文字阅读大概需要3分钟。
内容图文
![linux – 将脚本中的符号链接添加到rc.d文件夹中以在系统启动期间启动进程](/upload/InfoBanner/zyjiaocheng/965/0df5076aa99b4f0fbde707f80660e18d.jpg)
我正在使用fedora 15.
我试图添加MYSql守护进程在系统strtup期间启动.
我已经明白我必须将它添加到rc5.d,因为它是默认目标&是graphical.target.
来自inittab:
systemd uses ‘targets’ instead of runlevels. By default, there are two main targets:
multi-user.target: analogous to runlevel 3
graphical.target: analogous to runlevel 5
从An introduction to services, runlevels, and rc.d scripts 开始:
When the system is shut down, there is another symlink in the /etc/rc0.d and /etc/rc6.d directories (halt and reboot, respectively) that starts with a K instead of an S, which tells init to shut down the process.
我注意到httpd的符号链接存在于所有rc< number> .d文件夹中
作为符号链接:K15httpd – > ../init.d/httpd.
没有以S开头的符号链接.因为我必须手动启动它才有意义.
- Why is the symlink
K15httpd -> ../init.d/httpd
present in all therc<number>.d
folders?- What should I name the symlink if I want to start httpd during system startup?
- What is the number that is present in the symlink? i.e. K15httpd -> ../init.d/httpd what is 15 here?
- I read (07001) that the symlink to MYSql should be S98mysql is it right and what should the name to symlink that starts with K should be?
解决方法:
对于/etc/init.d中的任何一个,RC脚本的命名约定如下
>启动脚本S ##<基本脚本名称>
>杀死脚本K ##< base script name>
##表示在运行级别控制脚本运行期间执行脚本的顺序.脚本执行的顺序是:
>杀死脚本
>启动脚本
它的执行顺序与输出中的文件顺序相同:
`ls /etc/rc#.d/K*`
`ls /etc/rc#.d/S*`
因此,通过这个标记,K15httpd脚本的存在意味着在你的情况5的这个运行级别上应该停止apache(或另一个web服务).
同样,在较低级别的MySQL的kill脚本然后你启动它的那个将是K02MySQL.
您可以查看this link以了解有关编写System V init脚本的信息.
内容总结
以上是互联网集市为您收集整理的linux – 将脚本中的符号链接添加到rc.d文件夹中以在系统启动期间启动进程全部内容,希望文章能够帮你解决linux – 将脚本中的符号链接添加到rc.d文件夹中以在系统启动期间启动进程所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。