Shutdown signal protocol

Gary Dunn knowtree at aloha.com
Thu Jan 20 10:53:14 UTC 2011


On Fri, 2011-01-14 at 20:15 -0500, Joe Marcus Clarke wrote: 
> On 1/14/11 5:47 PM, knowtree at aloha.com wrote:
> > Can someone point me to info on the signals and protocol used by gnome 
> at liftoff 
[logoff]
> and shut down. I want a non-gnome app to respond gracefully to shut down.
> 
> Apps that obey XSMP should do the right thing.  gnome-session will also
> send a SIGTERM to all auto-spawned apps.
> 
> Joe
> 

The app in question is Squeak, specifically the Squeak VM. 

I guess I don't understand "auto-spawned apps." To get started I wrote a
little shell script that traps SIGTERM, then waits for input. The trap
calls a second script that also reads input. When I run the first and
kill -SIGTERM <pid> the trap works fine. When I run the first and logoff
or shutdown, there is no sign of the trap -- my session just closes down
as usual. I expected the logoff process to wait until I satisfied the
READ statement. I even expanded the trap list to

trap 'sqvmtrap2.sh;' 1 2 3 15

As for XSMP, the Squeak VM does not implement that. Someone has
suggested using D-BUS instead. I was trying to start simple, with a
SIGTERM trap, but I guess that is not an option. To me, D-BUS seems like
overkill when all I want is to save the current image in the event of a
logoff or shutdown. The way it is now, logging off without exiting
Squeak causes file system corruption.

-- 
Gary Dunn, Honolulu
Open Slate Project
http://openslate.org
http://www.facebook.com/garydunn808
http://e9erust.blogspot.com
Twitter @garydunn808
Sent from Slate001




More information about the freebsd-gnome mailing list