The best way to ensure some script/command running on shutdown is to use upstart which is the default init in CentOS6:
1 2 3 4 5 6 7 8 |
#/etc/init/instance-shutdown.conf start on starting rc RUNLEVEL=[016] task script # insert script action here end script |