From owner-freebsd-gnome@FreeBSD.ORG Sun Jan 23 08:02:49 2011 Return-Path: Delivered-To: freebsd-gnome@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C56F1065673 for ; Sun, 23 Jan 2011 08:02:49 +0000 (UTC) (envelope-from marcus@freebsd.org) Received: from av-tac-rtp.cisco.com (hen.cisco.com [64.102.19.198]) by mx1.freebsd.org (Postfix) with ESMTP id 57D9C8FC0A for ; Sun, 23 Jan 2011 08:02:49 +0000 (UTC) X-TACSUNS: Virus Scanned Received: from rooster.cisco.com (localhost.cisco.com [127.0.0.1]) by av-tac-rtp.cisco.com (8.13.8+Sun/8.13.8) with ESMTP id p0N82kZn024987; Sun, 23 Jan 2011 03:02:46 -0500 (EST) Received: from fruit-rollup.marcuscom.com (jclarke-pc.cisco.com [172.18.254.236]) by rooster.cisco.com (8.13.8+Sun/8.13.8) with ESMTP id p0N82hWQ022737; Sun, 23 Jan 2011 03:02:43 -0500 (EST) Message-ID: <4D3BE0A2.9050501@freebsd.org> Date: Sun, 23 Jan 2011 03:02:42 -0500 From: Joe Marcus Clarke Organization: FreeBSD, Inc. User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Gary Dunn References: <201101142247.p0EMlseq007084@smtpauth.pixi.com> <4D30F543.5030607@freebsd.org> <1295512727.1913.13.camel@slate01> In-Reply-To: <1295512727.1913.13.camel@slate01> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-gnome@freebsd.org Subject: Re: Shutdown signal protocol X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 08:02:49 -0000 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 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