For redhat, you need to make sure the /etc/init.d program is created. All of the files in this directory are start/stop/start_msg/stop_msg/status programs and all have the same format. Make sure your program runs from there (make something and then run 'program start' and 'program stop'. Then go to /etc/rc2.d and rc3.d and make the symbolic links. The S* programs are started in order and the K* programs run the 'stop' argument upon shutdown, reboot, or changing init run levels. the rc2/rc3.d means that it would run/kill in run levels 2 and 3, with 3 being multiuser and all services are running. This should help you...
We the willing, led by the unknowing, have been doing the impossible for the ungrateful. We have done so much with so little for so long that we are now qualified to do just about anything with almost nothing.