There is always some point of confusion between /etc/rc.d/init.d and /etc/rc.x.
Basically, the first one contains the start and stop scripts while the second one contains just links to the start and stop scripts. The rc.x is prefixed by S(start) or K(kill).
Keeping this on mind yesterday I wrote a small script for JBOSS developers working in my firm. They had a requirement of starting Jboss automatically when a machine boots up, I passed them this code and they were happy getting their application running on their CentOS box.