I have the following bash script on debian with the LSB header:
### 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
The script shutdown guest vms when host is shutdown. It runs fine for shutdown (0) and reboot (6).
The problem is, how do I make it run for user logout (when user log out, it should shutdown the vms)?
The rc2.d directory shows: K01shutdownvms which is the first script to run.
Is it possible to run the script on logout without using gdm PostSession/rc.local/bash.logout etc?