How do i run a script on startup?
If you choose to make it a normal startup script then the procedure for CentOS is as follows:
1. Put 2 comments into your script:
# chkconfig: 2345 90 10
# description: my_service - does this and that
Where the chkconfig line is the most important, it lists a. 2345 - runlevels the service will be started (by default), b. 90 - when the service is started when entering a runlevel (relative to others, look into /etc/rc3.d for example), c. 10 - when the service is stopped (relative to others, see /etc/rc0.d for example)
2. put your script into /etc/init.d, make it executable (usually chmod'ed to 755)
3. As root run "chkconfig --add my_service (if you put it in /etc/init.d/my_service)