Re: [gdm-list] GDM session shutdown - how to execute an script before apps are killed.

it didn't work :(

I did this:

ari copani:~$ cat /opt/azureus/

trap 'killall -SIGHUP java' TERM INT QUIT

ari copani:~$ 

What I noticed is that, when the wrapper process is killed, Java and its
apps stay up!  So I guess, when Java receives a TERM, the wrapper does not

So... another idea I had is to put the killall in the script that gets
executed when in GNOME menu I select System > Quit > (then I get this
mutibutton dialog, I'm using ubuntu feisty) Shutdown. Perhaps someone has a
clue about where this script is?


Dan Nicholson-2 wrote:
> On 5/10/07, Ari El <ari reads gmail com> wrote:
>> I need to automate the execution a command (killall -SIGHUP java) when my
>> GDM session closes (session logout), but *before* GDM kills all my active
>> session applications upon logout.
>> I've been playing with /etc/init.d/gdm and added my command line in the
>> "stop" code section, and this does get executed, but after my gdm session
>> is
>> closed, so it didn't help.
>> I also played with the "PostSession" scripts, but then again, these are
>> executed after all active user apps have been killed.
> So, you really need to run this killall before gnome-session ends and
> it's not OK to run them in PostSession? Why is that, out of curiosity?
> I don't think gdm can control that situation, then. It just waits for
> gnome-session to return before continuing its duties. And, as far as I
> know, there isn't a way to configure logout actions in gnome-session.
> It might be possible to make a wrapper script for this java app that
> signals it with SIGHUP when it receives SIGTERM. I don't know if that
> helps this situation, though. Something like
> #!/bin/sh
> trap 'killall -SIGHUP java' TERM
> java ...
> Since I think it will be sent TERM when gnome-session is trying to end.
> --
> Dan
> _______________________________________________
> gdm-list mailing list
> gdm-list gnome org

View this message in context:
Sent from the Gdm-list mailing list archive at

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]