Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I wrote some utility interactive scripts and want them run before shutdown.

For a terminal-login session, I just add some entry in ~/.bash_logout, my login shell is bash BTW, which works. However, I can't figure out how to configure in GNOME session -- How to run an interactive script before shutdown in a GNOME session -- even don't know is it possible. After searching the Internet, I find that /etc/gdm/PostSession/Default will be used to customize logout GNOME session. However, as stated on the main page

When a user terminates their session, GDM will run the PostSession script.
Note that the Xserver will have been stopped by the time this script is run,
so it should not be accessed.

It's not proper given the scripts are interactive.

Hope someone could give me a hand on this. Any hints will be high appreciated.

Thanks and Best regards.

share|improve this question
    

You must log in to answer this question.

Browse other questions tagged .