Openbox has nothing to do with Gnome so gdm wouldn't do anything.
You need to put the script
/etc/rc.d/init.d/. It needs to be a proper service script which can be run with...
Code:
service xyz start
service xyz stop
You should soft symlink your
/etc/rc.d/init.d/ script (ln -s) into
/etc/rc.d/rc0.d/ for the system halt and
/etc/rc.d/rc6.d/ for the system restart. Numbering it will give it a priority compared to the other S* and K* scripts. If the symlink starts with an 'S' then it will start the service (or execute a function) by way of "service xyz start". If the symlink starts with a 'K' then the service will be issued a stop command (i.e. "service xyz stop").
The question is,
why? Why do you want to run a script at shutdown or reboot?
And before blindly implementing my suggestion which simply gives you an overview of the process you should really do research into the Linux init process and how it pertains to your system. chkconfig does something similar.
SAM