chkconfig creating service symlinks with the wrong order

Posted by Robert on Server Fault See other posts from Server Fault or by Robert
Published on 2012-11-01T22:15:22Z Indexed on 2012/11/01 23:05 UTC
Read the original article Hit count: 330

Filed under:
|
|
|
|

On RHEL 6.3, I have a system service that should be starting after postgresql and httpd (order 64 and 85, respectively), but chkconfig always places it at order 50. I tried an experiment on a CentOS 6.0 virtual machine to make sure I understood the LSB stanza syntax.

I created /etc/init.d/foo, owner root, permissions 755, with this text:

### BEGIN INIT INFO
# Provides: foo
# Required-Start: postgresql httpd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: Foo init script
### END INIT INFO

And then ran chkconfig --add foo. Result: /etc/rc5.d/S86foo is created, as expected. (The other runlevels are also as expected.)

I repeated the exact same experiment on the RHEL machine, and it created /etc/rc5.d/S50foo instead. I can't see anything different between the two that would lead to different results. Both machines have postgresql and httpd starting at the same orders and runlevels. Any thoughts? I could just use # chkconfig: 2345 86 50, or manually rename the service symlinks to the correct order, but I'm trying to document an install process for later users, and I want to know how to do it right and understand why it's not working as expected.

© Server Fault or respective owner

Related posts about centos

Related posts about redhat