[ubuntu] Ubuntu Server - Shutdown script

view full story

http://ubuntuforums.org – Hello. I am running Ubuntu Server x64 12.04. I have apcupsd properly running. I would like my server to run a script before it is shutdown by apcupsd. Since I didn't find something specific for a shutdown from apcupsd, I tried to make a general shutdown script, putting it at init.d and running update-rc.d for making the symlinks in rc0.d (shutdown) and rc6.d (restart). My script is for making a backup of a mysql database. When I tested it shuting down the server, the script was run, but the resulting file was empty. That leads me to think the script didn't have the proper time to finish. S (Hardware)