[CentOS] use chkconfig to change service startup order

Robin Mordasiewicz

robin at bullseye.tv
Mon Dec 19 20:10:51 UTC 2005


On Mon, 19 Dec 2005, Erick Perez wrote:

> Hi, I have my httpd process that starts in runlevel3 with the following info
>
> # chkconfig: - 85 15
> # description: Apache is a World Wide Web server.  It is used to serve \
> #              HTML files and CGI.
> # processname: httpd
> # pidfile: /var/run/httpd.pid
> # config: /etc/httpd/conf/httpd.conf
>
> the filename is /etc/rc.3.d/K15httpd
>
> However I installed an antivirus that uses a tomcat process that *must* be
> started prior to apache.
> the antivirus has the filename /etc/rc3.d/S99ISproxy
>
> How can I make the httpd start *after* the S99ISproxy process?

the file /etc/rc3.d/S99ISproxy is actually a symlink that is created by 
chkconfig which points to /etc/init.d/ISproxy

the number 85 and 15 represent the order number which the script is to be 
run at start up time and shutdown time.

after running
"chkconfig httpd on"

you will find a symlinks
/etc/rc3.d/S85httpd -> /etc/init.d/httpd
/etc/rc6.d/K15httpd -> /etc/init.d/httpd

chkconfig reads the startup script named httpd and finds the line which 
starts with "# chkconfig:" and then creates the symlinks in /etc/rc3.d and 
/etc/rc4.d based on the numbers. The symlinks in the rc3.d directory are 
executed in order.

You can edit the numbers at the top of the init script

In your case you would either change your anti virus startup script to 
start before httpd, or modify your httpd startup script. I would modify 
the anti-virus startup script so that it had

< snip /etc/init.d/ISproxy >
# chkconfig: - 84 16
< /snip >





More information about the CentOS mailing list