I have a script that shuts down all guest VMs when the host is shutdown.

The LSB header for the script which Debian uses is:
### BEGIN INIT INFO
# Provides: shutdown_vms
# Required-Start:
# Required-Stop: gdm vmware $local_fs $remote_fs $network
# Default-Start:
# Default-Stop: 0 2 3 4 5 6
# Short-Description: Shutdown vms
# Description: Shutdown vms
### END INIT INFO

When I shutdown/reboot the host, the script successfully shuts down the guest VMs.

However, how do I make it run so that when user logs out of their gnome-session, it will run the script as well?

Currently, rc2.d directory shows the following:
K01shutdown_vms

but it is not running. Is it because runlevel1-5 is used for booting only while 0/6 are used for stopping services.

I rather not use rc.local or gdm Postsession scripts.