Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.