简体   繁体   English

运行级别init.d和rc.d

[英]runlevels init.d and rc.d

I am not sure to ask it here or at serverfault, but it has to do with my script and creating an installer... 我不确定在这里还是在serverfault上问这个问题,但这与我的脚本和创建安装程序有关。

I have made a service (linux perl script) and all the configuration files and etc etc. I would like to make an installer for it so it creates folders/puts files on the right spot, etc. 我已经提供了服务(Linux perl脚本)以及所有配置文件等,我想为其安装安装程序,以便它在正确的位置创建文件夹/ p​​uts文件等。

Now while developing I made a script in the /etc/init.d/ folder called "reliand". 现在,在开发过程中,我在/etc/init.d/文件夹中创建了一个名为“ reliand”的脚本。

Now when I send all my files, plus the installer to another user and I would copy that file to the same dir on that machine (i know it's same CENTOS) how would I make it run at the right runlevel? 现在,当我将所有文件以及安装程序发送给另一个用户,然后将文件复制到该计算机上的同一目录(我知道它是相同的CENTOS)时,如何使它在正确的运行级别运行?

Do I need to make a link in the rd3.d folder? 我需要在rd3.d文件夹中建立链接吗? or is there a command to run so it will place itself in the correct runlevels. 或者是否有要运行的命令,以便将其放置在正确的运行级别中。

Thanks for the explanation. 感谢您的解释。

Use chkconfig --add and add something like: 使用chkconfig --add并添加如下内容:

# chkconfig: 345 20 80
# description: my service

to your script in /etc/init.d /etc/init.d的脚本

Oh ... and https://serverfault.com/ is definitely a better place for this question. 哦...而且https://serverfault.com/绝对是解决此问题的好地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM