Shutdown signal protocol

Joe Marcus Clarke marcus at freebsd.org
Sun Jan 23 08:02:49 UTC 2011


On 1/20/11 3:38 AM, Gary Dunn wrote:
> 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.
> 

Auto-spawned apps are those spawned from .desktop files when
gnome-session starts.  You can add your app to the using the Startup
Applications capplet.

Joe

-- 
Joe Marcus Clarke
FreeBSD GNOME Team	::	gnome at FreeBSD.org
FreeNode / #freebsd-gnome
http://www.FreeBSD.org/gnome


More information about the freebsd-gnome mailing list