Date: Thu, 20 Jan 2011 00:38:47 -0800 From: Gary Dunn <knowtree@aloha.com> To: Joe Marcus Clarke <marcus@freebsd.org> Cc: freebsd-gnome@freebsd.org Subject: Re: Shutdown signal protocol Message-ID: <1295512727.1913.13.camel@slate01> In-Reply-To: <4D30F543.5030607@freebsd.org> References: <201101142247.p0EMlseq007084@smtpauth.pixi.com> <4D30F543.5030607@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2011-01-14 at 20:15 -0500, Joe Marcus Clarke wrote: > On 1/14/11 5:47 PM, knowtree@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1295512727.1913.13.camel>