newbie question... how can I get my script init script to start when linux boots. Can I just drop a script into the /etc/init.d directory and make manual links to rcX.d?
新手问题…如何让我的脚本初始化脚本在linux引导时启动。我可以把脚本放到/etc/ initit中吗?d目录和手动链接到rcX.d?
Thanks
谢谢
2 个解决方案
#1
1
The file /etc/rc.local
is a good candidate for local jobs, and it avoids some of the complexity of using /etc/init.d/
and similar directories.
文件/etc/rc.local是本地工作的好候选者,它避免了使用/etc/ initit的复杂性。d /和类似的目录。
Just add a line to /etc/rc.local
to launch your job.
只要在/etc/rc中添加一行即可本地启动你的工作。
#2
1
Yes, you are right. You can read on this: http://www.cyberciti.biz/tips/linux-how-to-run-a-command-when-boots-up.html
是的,你是对的。您可以在这里阅读:http://www.cyberciti.biz/tips/linux-how-to-run-a-command-when-boots-up.html
#1
1
The file /etc/rc.local
is a good candidate for local jobs, and it avoids some of the complexity of using /etc/init.d/
and similar directories.
文件/etc/rc.local是本地工作的好候选者,它避免了使用/etc/ initit的复杂性。d /和类似的目录。
Just add a line to /etc/rc.local
to launch your job.
只要在/etc/rc中添加一行即可本地启动你的工作。
#2
1
Yes, you are right. You can read on this: http://www.cyberciti.biz/tips/linux-how-to-run-a-command-when-boots-up.html
是的,你是对的。您可以在这里阅读:http://www.cyberciti.biz/tips/linux-how-to-run-a-command-when-boots-up.html