据我了解,我认为我需要添加一些init.d,但我不知道要添加什么。 现在开始clamav我必须做clamd开始。 我希望它作为一项服务,所以我可以在运行级别3作为服务启动它。 我意识到我可以通过在正确的运行级别的shell脚本来做到这一点,但我希望能够使用chkconfig来configuration它。
我尝试使用提到的模板来产生下面的内容,但是chkconfig仍然没有列出它:
#!/bin/bash clamd This starts and stops clamd. chkconfig: 3 description: Clamd is a virus scanner. processname: /usr/local/sbin/clamd/clamd config: /etc/clamd.conf pidfile: /var/run/clamd.pid
如果您使用yum从存储库安装了clamav,则在安装软件包时,应该已经安装并configuration了脚本。
你可以像ln -s /etc/init.d/clamd /etc/rc3.d/S90clamd这样做,或者像你说的那样使用chkconfig
但是,如果你从一个软件包安装,所有这些都应该是为你完成的。
你可以设置一个shell脚本,并且可以使用chkconfig来configuration它。 看看/etc/init.d/中的文件的顶部。 他们都有一个chkconfig理解的文件顶部的模板。 例如:
#!/bin/bash # # xinetd This starts and stops xinetd. # # chkconfig: 345 56 50 # description: xinetd is a powerful replacement for inetd. \ # xinetd has access control mechanisms, extensive \ # logging capabilities, the ability to make services \ # available based on time, and can place \ # limits on the number of servers that can be started, \ # among other things. # # processname: /usr/sbin/xinetd # config: /etc/sysconfig/network # config: /etc/xinetd.conf # pidfile: /var/run/xinetd.pid