I'm trying to find a solution to halt an application during the shutdown process. It appears that launchd does not support signals trapped from shutdown.

I have Snow Leopard (10.6.x), on it I have VMWare and one of its instances is a Linux VM running Oracle 11g (there currently is no distribution for Mac OS X). I have scripts to pause the VM and I'd like to find a way to pause the system during a shutdown.

I have found a couple of very crude solutions, namely a launchd daemon that pings itself, when network dies then run shutdown. For several reasons this solution is not ideal, here are a few issues:
1. It unnecessarily consumes a minor bit of network bandwidth,
2. It waits until the network is dead, thus it effectively runs much later than I'd like.
3. Its sensitivity is dependant upon how fast you repeatedly test (sample) ping.

Does Mac OSX Server do this differently? Is there something akin to /sbin/init.d/Kxxxxx or /etc/init.d/<script> that can get called?

Is there another distribution to launchd with this functionality?

Thanks in Advance!