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



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



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