From owner-freebsd-current@FreeBSD.ORG Mon Jul 26 15:51:54 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D05FE106564A for ; Mon, 26 Jul 2010 15:51:54 +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 8ECF88FC18 for ; Mon, 26 Jul 2010 15:51:54 +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 o6QFNtus008579; Mon, 26 Jul 2010 11:23:55 -0400 (EDT) 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 o6QFNt51013149; Mon, 26 Jul 2010 11:23:55 -0400 (EDT) Message-ID: <4C4DA88B.3090208@freebsd.org> Date: Mon, 26 Jul 2010 11:23:55 -0400 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.7) Gecko/20100713 Thunderbird/3.1.1 MIME-Version: 1.0 To: =?UTF-8?B?6KO05Zu95YW0?= References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: freebsd-current@freebsd.org Subject: Re: gnome 2.30 slow startup (Could not ask session manager if shut down is available) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2010 15:51:54 -0000 On 7/26/10 10:46 AM, 裴国兴 wrote: > Recently, I update my FreeBSD to 8.1, and Found that gnome 2.30 startup very > slow. It take one nimus or more to finish startup. > When startup, the gnome-panel will display after nautilus about 30 seconds. > >>From the console, I see that > > 1、gnome-session[1935]: WARNING: Application 'metacity.desktop' failed to > register before timeout > --------- after about 30 seconds ---------- > 2、** (gnome-panel:1966): WARNING **: Could not ask session manager if shut > down is available: Did not receive a reply. Possible causes include: the > remote application did not send a reply, the message bus security policy > blocked the reply, the reply timeout expired, or the network connection was > broken. > > I recompile metacity, and "WARNING: Application 'metacity.desktop' failed to > register before timeout" disappear. > > I try to recompile gnome-session, but not work. > Finally, I do a little change for gnome-session and compile, it work. > the change file is gsm_manager.c > GsmConsolekit *consolekit; > gboolean can_suspend = 0; > gboolean can_hibernate = 0; > > #if 0 > g_object_get (manager->priv->dkp_client, > "can-suspend", &can_suspend, > "can-hibernate", &can_hibernate, > NULL); > #endif > > g_debug ("GsmManager: CanShutdown called"); > > g_return_val_if_fail (GSM_IS_MANAGER (manager), FALSE); > > consolekit = gsm_get_consolekit (); > *shutdown_available = gsm_consolekit_can_stop (consolekit) > || gsm_consolekit_can_restart (consolekit) > || can_suspend > || can_hibernate; > g_object_unref (consolekit); > *shutdown_available = 0; > > I use following command to start session > > setenv GNOME_SESSION "/usr/local/bin/ck-launch-session > /usr/local/bin/gnome-session" > env LC_ALL=zh_CN.UTF-8 XMODIFIERS=@im=ibus startx $GNOME_SESSION > > I also found that if login user is root, it works very well. > > The question is why the g_object_get call will take such a long time on > non-root user. This is fixed in the latest sysutils/consolekit. Prior to the fix, sessions started with startx were not marked as active, and thus could not be properly authorized. Joe -- Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome