[OpenIndiana-discuss] SIGKILL happens too soon upon logout of GNOME session

Jim Klimov jimklimov at cos.ru
Sat Oct 27 11:53:36 UTC 2012

Hello all,

   I'm trying to write a program that would properly close itself
upon SIGTERM, SIGINT, SIGQUIT and similar signals, in particular
during user's exit from an X session such as GNOME.

(To be more specific, I'm expanding my vboxsvc framework to cause
proper shutdown or savestate of VMs that a user runs interactively
in GUI mode - and either of these procedures takes at least a few

   What I see in practice is that when I log out from GNOME I see
a warning dialog (Do you want to log out now or switch the user?)
and when I confirm the logout, the program is terminated almost
instantly. I think a SIGTERM is sent out to each process spawned
by the X console, but is followed by a SIGKILL a second or two
afterwards. My script does trap the first signal and begins VM
stop, but finds that the VM process is already "aborted".
   My script does work as planned when I just CTRL+C in it or close
the terminal that runs it - it saves the launched VM instead of
aborting it.

   Is it possible to set a larger delay between initiation of X
session ripdown (and does it send only SIGTERM?) and the ultimate
unconditional SIGKILLing spree, and/or disable the latter until
all X processes die properly as asked by SIGTERM? For example,
Windows displays a nice dialog with the list of remaining live
programs, a timer until forced logout/poweroff, and an option
to either abort the logout or to force it now. Anything similar
in OI or generic GNOME?

   I think (partially) suitable options are defined for the
gnome-session-save program, but I don't yet see how that can
be configured at startup of the gdm service (or it does not
have to be?)

//Jim Klimov

More information about the OpenIndiana-discuss mailing list