[comp.windows.x] Starting X server in inittab

hobbes@portia.Stanford.EDU (Andrew Zimmerman) (10/05/89)

What is the correct entry in /etc/inittab to automatically start the
X server on a Sys V machine?  The machine is an intel 386 machine running
AT&T Sys V.  Currently, X will run on the machine with an xinit command,
but we are having problems figuring out the correct entry for the inittab.
All of the documentation and experience we have is for X on bsd with
a /etc/ttys file.

Thanks for any help.

Andrew Zimmerman
zimmer@umunhum.stanford.edu

gary@dgcad.SV.DG.COM (Gary Bridgewater) (10/07/89)

In article <5561@portia.Stanford.EDU> hobbes@portia.Stanford.EDU (Andrew Zimmerman) writes:
>What is the correct entry in /etc/inittab to automatically start the
>X server on a Sys V machine?

I don't know about correct but the Consortium seems to be pushing xdm. We have
a heterogenous environment here with programmers and non-programmers and teaching
the latter all the mysteries of the temple is a daunting task. So I spent an
afternoon getting xdm to work on our (AViiON - SysV) environment. I will go
after Sun next.
The way I got it to work was to modify inittab like this:
con:012:respawn:/usr/sbin/getty console console                 
X:34:once:/var/adm/xdm.run

So that I get a vanilla console at any level below 3 and X for 3 or 4. Note
the "once". Using "respawn" brings on the X-Servers-From-Hell syndrome.

and xdm.run is:
#!/bin/csh
source /etc/TIMEZONE.csh
set MGR=/usr/bin/X11/xdm
set MESS=/var/xdm/X0msgs
cp /dev/null ${MESS}
sleep 4
if ( -x ${MGR} ) then
	exec ${MGR} -config /var/adm/xdm.config
else
	echo "`date` - Cannot find ${MGR}" >> ${MESS}
	exec /usr/sbin/getty console console
endif

which you hack to work around the pecadillos of Your OS.

then xdm.config looks like this:
DisplayManager.servers:		:0 local /usr/bin/X11/X :0
DisplayManager*resources:	/var/adm/xdm.resources
DisplayManager.0.userPath:	:/usr/local/bin:/usr/bin/X11:/usr/bin:/bin:/usr/ucb:/etc:/usr/hosts:/usr/global/bin
DisplayManager.0.systemPath:	/usr/local/bin:/usr/bin/X11:/usr/bin:/bin:/usr/ucb:/etc:/usr/hosts:/usr/global/bin
DisplayManager.0.systemShell:	/bin/sh
DisplayManager.0.session:	/var/adm/xdm.Xsession
DisplayManager.0.openDelay:	5
DisplayManager.0.openTimeout:	60
DisplayManager.0.terminateServer:	true

again, this represents my preferences. Salt to taste.
xdm.resources is pretty familiar:
xlogin*foreground:	white
xlogin*background:	black
xlogin*promptFont:	9x15
xlogin*failFont:	9x15
xlogin*greetFont:	9x15
xlogin*nameFont:	9x15
xlogin*passwdFont:	9x15
xlogin*font:		9x15
xlogin*greeting:	Something sppropriate here..
xlogin*greetColor:	white
xlogin*namePrompt:	Who are you?_
xlogin*passwdPrompt:	Prove it :
xlogin*promptColor:	white
xlogin*fail:		I doubt it.
xlogin*failColor:	white
xlogin*failTimeout:	60
xlogin*borderColor:	white
xlogin*borderWidth:	10
xterm*ActiveIcon:	off
xterm*blahBlahBlah ...
... rest of the xterm stuff you want to specify ...

But the key here is that you pre-specify an xterm so
the novice user gets some nice (BIG) generic window and a bunch
of generic menu pushes.

I won't reproduce my xdm.Xsession since it is pretty much right
out of the man page. I added some stuff to look for alternate user
preference files. By default it looks for a .xsession file in the users $HOME.
This file is more or less just what a .xinitrc file would be if you put
everything in it that you specify on the xinit command line ( start a uwm,
xrdb, xset, clock, Console flavor xterm, etc.). If no .xsession is found
then xdm.Xsession cranks up uwm and an xterm using the above defaults.

If you do all this you get an X login and a generic, default xterm for everyone
so they don't have to learn the immense amount of drek involved in becoming
an Xconsole commander. As they learn, they can start building their .xsession,
.uwmrc, .Xdefaults and on and on and on and on ... An added benefit, for those
who know what I mean, is that this resets the console to a good, know, totally
erased state with just the X background and a login window.
-- 
Gary Bridgewater, Data General Corp., Sunnyvale Ca.
gary@sv4.ceo.sv.dg.com or 
{amdahl,aeras,amdcad,mas1,matra3}!dgcad.SV.DG.COM!gary
No good deed goes unpunished.