Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Apr 2009 14:08:33 -0500
From:      Robert Noland <rnoland@FreeBSD.org>
To:        David Wolfskill <david@catwhisker.org>
Cc:        Tim Kientzle <kientzle@freebsd.org>, Joe Marcus Clarke <marcus@freebsd.org>, current@freebsd.org
Subject:   Re: Hal and KDM breakage (was Re: KDE4 and input events stalled)
Message-ID:  <1239131313.1947.18.camel@balrog.2hip.net>
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

--=-mo9/ia6I4HzGfK3QCXfX
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Tue, 2009-04-07 at 11:59 -0700, 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 t=
o
> > come up after the getty processes have been spawned (i.e. after init ha=
s
> > started the ttys).
>=20
> That would seem to contraindicate xdm (or similar) startup from
> /etc/ttys, in general.
>=20
> > If the ttys were started as part of the rc.d process, this could be avo=
ided.
>=20
> Hmmm..
>=20
> > This is why GNOME makes people use the rc.d script to start gdm.  It
> > just won't work out of /etc/ttys.
>=20
> OK; I use xdm.  And following what I thought was appropriate, I fired it
> up out of /etc/ttys.
>=20
> 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).
>=20
> That's worked for ... well, years.
>=20
> But since hald(8) became involved in X, things got a bit ugly.
>=20
> 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.
>=20
> 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.

Note that it is dbus that needs to be active and working before
something tries to start X... X will wait on hald for a bit.

X will start up, register with dbus and ask for info from hald.  If hald
isn't up, or ready it will loop for a bit, waiting.  Once hald is up and
registers with dbus it will proceed.  At least that is my recollection
of how the code worked.

robert.

> 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:
>=20
>=20
> #! /bin/sh
>=20
> # PROVIDE: xdm
> # REQUIRE: hald dhclient moused ip_addr
> # KEYWORD: nostart
>=20
> # This script is to be started from /etc/ttys, not /etc/rc.
>=20
> . /etc/rc.subr
>=20
> name=3D"xdm"
>=20
> case "$1" in
> start)
> 	if ! hald=3D$(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=3D`awk -F "[ ,]" '{print $8}' /proc/${hald}/status`
> 	now=3D`date "+%s"`
> 	# This was determined empirically
> 	hald_delay=3D8
> 	wait=3D$(($hald_start + $hald_delay - $now))
> 	if [ $wait -gt 0 ]; then
> 		info "$name start-up waiting $wait seconds for hald-addon-mouse-sysmous=
e"
> 		sleep $wait
> 	fi
> 	if [ -x /usr/local/bin/xdm ]; then
> 		old_dir=3D/usr/local/lib/X11/xdm
> 		new_dir=3D`/usr/bin/mktemp -d /tmp/.xdm-XXXXX`
> 		uname=3D`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
>=20
> exit 0
>=20
>=20
> [I originally tried merely sleeping a bit, but eventually found it more
> reliable to merely exit the script & let init(8) re-spawn it.)
>=20
> Peace,
> david
--=20
Robert Noland <rnoland@FreeBSD.org>
FreeBSD

--=-mo9/ia6I4HzGfK3QCXfX
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEABECAAYFAknbpLEACgkQM4TrQ4qfROPnFwCeMCiKkSHMmjniprD3Ig6Vwk4Q
pvwAoIYY9ZGU8WAehkRUbMkmRG1Z+z8J
=r4pv
-----END PGP SIGNATURE-----

--=-mo9/ia6I4HzGfK3QCXfX--




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