From owner-freebsd-current@FreeBSD.ORG Tue Apr 7 19:25:23 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3C931065731; Tue, 7 Apr 2009 19:25:23 +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 891EA8FC12; Tue, 7 Apr 2009 19:25:23 +0000 (UTC) (envelope-from marcus@freebsd.org) 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 n37J3E2E017410; Tue, 7 Apr 2009 15:03:14 -0400 (EDT) Received: from [64.102.220.171] (dhcp-64-102-220-171.cisco.com [64.102.220.171]) by rooster.cisco.com (8.13.8+Sun/8.13.8) with ESMTP id n37J3Esu007544; Tue, 7 Apr 2009 15:03:14 -0400 (EDT) Message-ID: <49DBA371.3080804@freebsd.org> Date: Tue, 07 Apr 2009 15:03:13 -0400 From: Joe Marcus Clarke Organization: FreeBSD, Inc. User-Agent: Thunderbird 2.0.0.21 (Macintosh/20090302) MIME-Version: 1.0 To: David Wolfskill , Joe Marcus Clarke , Tim Kientzle , current@freebsd.org, Robert Noland References: <934e1d760904061455o4736d643o1d07e3292192d94c@mail.gmail.com> <1239057809.1908.2.camel@balrog.2hip.net> <49DAC742.8090507@freebsd.org> <1239075455.1908.36.camel@balrog.2hip.net> <49DACDBD.3030809@freebsd.org> <1239077210.1908.39.camel@balrog.2hip.net> <49DAD429.6090309@freebsd.org> <1239078081.1908.41.camel@balrog.2hip.net> <49DAE987.7090802@freebsd.org> <1239086408.35025.59.camel@shumai.marcuscom.com> <20090407185915.GY31409@albert.catwhisker.org> In-Reply-To: <20090407185915.GY31409@albert.catwhisker.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Re: Hal and KDM breakage (was Re: KDE4 and input events stalled) 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: Tue, 07 Apr 2009 19:25:26 -0000 David Wolfskill wrote: > On Tue, Apr 07, 2009 at 02:40:08AM -0400, Joe Marcus Clarke wrote: >> ... >> The problem is due to the fact that console-kit-daemon will not work if >> it starts up before init has started the ttys. Therefore, hald needs to >> come up after the getty processes have been spawned (i.e. after init has >> started the ttys). > > That would seem to contraindicate xdm (or similar) startup from > /etc/ttys, in general. > >> If the ttys were started as part of the rc.d process, this could be avoided. > > Hmmm.. > >> This is why GNOME makes people use the rc.d script to start gdm. It >> just won't work out of /etc/ttys. > > OK; I use xdm. And following what I thought was appropriate, I fired it > up out of /etc/ttys. > > I did, however, want to tweak things a bit; in particular, since I > regularly flip my laptop among stable/6, stable/7, and head, I wanted > the login screen to provide a hint as to what the machine was running at > the time. So I cobbled up a shell script to copy Xresources to an > appropriate place & apply sed(1) using selected output of uname(1). > > That's worked for ... well, years. > > But since hald(8) became involved in X, things got a bit ugly. > > In particular, it seemed that xdm was getting started before hald, and > that just wasn't helpful. At least with the above explanation, I'm > beginning to see why that is. > > I tweaked dependencies to force xdm to come up after hald, but even so, > that didn't help much: it seems that hald isn't really ready to provide > the services asked of it immediately. > > So I hacked my xdm start-up script; it's got to the point where it seems > to work pretty reliaably for me; maybe it will help someone else: > > > #! /bin/sh > > # PROVIDE: xdm > # REQUIRE: hald dhclient moused ip_addr > # KEYWORD: nostart > > # This script is to be started from /etc/ttys, not /etc/rc. > > . /etc/rc.subr > > name="xdm" > > case "$1" in > start) > if ! hald=$(check_process hald-addon-mouse-sysmouse); then > sleep 5 > exit 1 > fi > if [ ! -r /proc/${hald}/status ]; then > sleep 5 > exit 1 > fi > hald_start=`awk -F "[ ,]" '{print $8}' /proc/${hald}/status` > now=`date "+%s"` > # This was determined empirically > hald_delay=8 > wait=$(($hald_start + $hald_delay - $now)) > if [ $wait -gt 0 ]; then > info "$name start-up waiting $wait seconds for hald-addon-mouse-sysmouse" > sleep $wait > fi > if [ -x /usr/local/bin/xdm ]; then > old_dir=/usr/local/lib/X11/xdm > new_dir=`/usr/bin/mktemp -d /tmp/.xdm-XXXXX` > uname=`uname -v | sed -e "s/ .*$//"` > sed -e "s/ Welcome to CLIENTHOST/ CLIENTHOST - ${uname}/" \ > -e "/greetFont/s/24-240/18-180/" \ > -e "s/Serif-24/Serif-18/" \ > ${old_dir}/Xresources >${new_dir}/Xresources > /usr/local/bin/xdm -nodaemon -resources "${new_dir}/Xresources" > fi > info "Starting ${name}." > ;; > stop) > [ -r /var/run/xdm.pid ] && \ > kill `cat /var/run/xdm.pid` && \ > rm -fr /tmp/.xdm-????? && \ > info -n ' xdm' > ;; > restart) > $0 stop; $0 start > ;; > *) > err 1 "Usage: `basename $0` {start|stop}|restart" > ;; > esac > > exit 0 > > > [I originally tried merely sleeping a bit, but eventually found it more > reliable to merely exit the script & let init(8) re-spawn it.) See /usr/ports/x11/gdm/files/gdm.in. This is working for GNOME users. Joe -- Joe Marcus Clarke FreeBSD GNOME Team :: gnome@FreeBSD.org FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome