Date: Sun, 23 Jan 2011 03:02:42 -0500 From: Joe Marcus Clarke <marcus@freebsd.org> To: Gary Dunn <knowtree@aloha.com> Cc: freebsd-gnome@freebsd.org Subject: Re: Shutdown signal protocol Message-ID: <4D3BE0A2.9050501@freebsd.org> In-Reply-To: <1295512727.1913.13.camel@slate01> References: <201101142247.p0EMlseq007084@smtpauth.pixi.com> <4D30F543.5030607@freebsd.org> <1295512727.1913.13.camel@slate01>
next in thread | previous in thread | raw e-mail | index | archive | help
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@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@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D3BE0A2.9050501>