1

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?

1 Answer 1

2

If I understand you correctly, you are asking if Debian's upstart can do it. No it can't. You have to use the mechanisms that you've mentioned.

But please re-consider the whole thing, because it is extremely rare practice to shutdown a system service (i.e. possibly used by multiple users) on one user's logout.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .