Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Apr 2009 15:03:13 -0400
From:      Joe Marcus Clarke <marcus@freebsd.org>
To:        David Wolfskill <david@catwhisker.org>, Joe Marcus Clarke <marcus@freebsd.org>, Tim Kientzle <kientzle@freebsd.org>, current@freebsd.org, Robert Noland <rnoland@freebsd.org>
Subject:   Re: Hal and KDM breakage (was Re: KDE4 and input events stalled)
Message-ID:  <49DBA371.3080804@freebsd.org>
In-Reply-To: <20090407185915.GY31409@albert.catwhisker.org>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49DBA371.3080804>