[英]How to set order in init scripts?
I create some /etc/init scripts, but one script (script B) depend on other (script A). 我创建了一些/ etc / init脚本,但是一个脚本(脚本B)依赖于另一个(脚本A)。 How to order execution of those scripts? 如何命令执行这些脚本? I want to system first execute script A, and then script B. Process that start script B will be killed and execute again couple of times during one day, and I want to script A execute only on reboot not every time before script B. How to do that? 我要系统先执行脚本A,然后执行脚本B。启动脚本B的进程将被终止,并在一天之内再次执行两次。我想让脚本A仅在重新启动时才执行,而不是每次在脚本B之前都执行。要做到这一点?
You have a couple of options: 您有两种选择:
script A
outside /etc/init
and make a call to it in the very beginning of script B
. 将script A
放在/etc/init
之外,并在script B
开始处对其进行调用。 script B
outside /etc/init
and make a call to it in the very end of script A
将script B
放在/etc/init
之外,并在script A
末尾对其进行调用 EDIT 编辑
If the calling sequence is always A; B
如果呼叫顺序始终为A; B
A; B
for B
, but A
runs independently only on reboot, you have another option: A; B
代表B
,但是A
仅在重新启动时独立运行,您还有另一个选择:
script B
outside /etc/init
since it does not belong there and call /etc/init/A
from the beginning of it. 将script B
放在/etc/init
因为它不属于/etc/init/A
从其开头调用/etc/init/A
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.