From owner-freebsd-current Wed Apr 22 06:35:19 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA10113 for freebsd-current-outgoing; Wed, 22 Apr 1998 06:35:19 -0700 (PDT) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from outmail.utsunomiya-u.ac.jp (outmail.utsunomiya-u.ac.jp [160.12.196.3]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id NAA10103 for ; Wed, 22 Apr 1998 13:35:16 GMT (envelope-from yokota@zodiac.mech.utsunomiya-u.ac.jp) Received: by outmail.utsunomiya-u.ac.jp id AA28176; Wed, 22 Apr 1998 22:34:35 +0900 Received: from zodiac.mech.utsunomiya-u.ac.jp (zodiac.mech.utsunomiya-u.ac.jp [160.12.42.1]) by zodiac.mech.utsunomiya-u.ac.jp (8.7.6+2.6Wbeta7/3.4W/zodiac-May96) with ESMTP id WAA10534; Wed, 22 Apr 1998 22:43:16 +0900 (JST) Message-Id: <199804221343.WAA10534@zodiac.mech.utsunomiya-u.ac.jp> To: dag-erli@ifi.uio.no Cc: current@FreeBSD.ORG, yokota@zodiac.mech.utsunomiya-u.ac.jp Subject: Re: Disappearing keyboard In-Reply-To: Your message of "22 Apr 1998 13:29:44 +0200." References: <199804220516.OAA00391@zodiac.mech.utsunomiya-u.ac.jp> Date: Wed, 22 Apr 1998 22:43:15 +0900 From: Kazutaka YOKOTA Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >Kazutaka YOKOTA writes: >> AFAIK, there are four ways to start xdm and avoid conflicts with getty. >> >> 1. Specify xdm in /etc/ttys. If you want to run xdm in ttyv3, you write: >> >> ttyv3 "/usr/X11R6/bin/xdm -nodaemon" xterm on secure > >This is evil and should never have been suggested in the docs. I knew some people don't like this :-) To me it is a matter of preference. >> 2. Run xdm from /etc/rc.local (or other rc* files). >> [...] >> 3. Another way to run xdm from /etc/rc.local (or other rc* files). >> [...] > >There is a better way, see below. > >> 4. Specify the X server in /etc/ttys. >> >> ttyv3 "/usr/X11R6/bin/X vt4 -query localhost" xterm on secure > >Again, this is evil. > >The Right Way (tm) to start X or xdm is to put a shell script in >/usr/local/etc/rc.d which Does the Deed. It will work, no questions >asked. I have something similar to this: I picked up /etc/rc.local simply because it was what the original poster was using. I don't care which rc script you would prefer to use for this purpose. >#!/bin/sh >if [ -r /noxdm ] ; then > echo -n " (xdm disabled)" >else > [ -x /usr/X11R6/bin/xdm ] && /usr/X11R6/bin/xdm && echo -n " xdm" >fi > >in /usr/local/etc/rc.d/xdm.sh. > >If you're picky about the execution order of /usr/local/etc/rc.d/*, >use a numeric prefix for each script, as in /etc/periodic/*. Umm, I am puzzled. I don't see why this particular version should solve the original poster's problem. We are talking about possible conflict between getty and xdm. We usually turn on getty on some vtys, say ttyv0 through ttyv2. When xdm is started from /etc/rc.local (or /usr/local/etc/rc.d/something), getty has not yet been started. Therefore, ttyv1 through ttyv2 are not in use and is available. If getty is not yet running when xdm tries to start the X server, the X server will pick up the first available vty, in this case ttyv1. Then, init starts getty on ttyv1 and you get two programs, the X server and getty, trying to read the keyboard in ttyv1... This is a timing problem. If getty has been started in ttyv1 through ttyv2 BEFORE xdm starts the X server, the X server will see ttyv3 is available and will use it, then you have no conflict. That's why I suggested to put `sleep N' before starting xdm from rc.local (or whichever rc script) so that getty will run before the X server, or explicitly specify a vty in which to run the X server. Kazu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message