Linux shut-down/boot is separated into ~6 runlevels. Every runlvl is launched as script in correct order. So you have just simply add your program to desired runlvl. I can not post more accurate how-to because I do not know your Red-Hat version.
Much more general info about those things here:
I use red hat linux kernel 2.6
I want to add the application shutdown in shutdown sequence .
I add the K script in /etc/rc.d/ all sub directory for all
running level .
But the auto shutdown application is not appear when
I type "shutdown -r now" ..
There is no indication the application shutdown in the
The shutdown seq is hang/stop and I need to shutdown the application
by command manually .Then the shutdown process can be continue ....
how can I change the shutdown seq ???
Any advice ...