Hi folks
I have a linux box running RH6.x that I want to have booting directly in to X-windows without having to log in first. The various network services still need to be started so that I can telnet in - Question is, in what order are the start up scripts run, and which one(s) do I need to hack to skip the login ? Or better still, where can I find documents on the boot sequence ?
Regards, Paul.
on Sat, Dec 01, 2001 at 08:43:26PM +0000, Paul wrote:
I have a linux box running RH6.x that I want to have booting directly in to X-windows without having to log in first. The various network services still need to be started so that I can telnet in - Question is, in what order are the start up scripts run, and which one(s) do I need to hack to skip the login ?
The login is in two parts. The login: prompt is caused by getty, which is launched by init on the correct tty. The password: prompt is from /bin/login. I think roothat uses mingetty. inittab will tell you.
Or better still, where can I find documents on the boot sequence ?
inittab(5), init(8) man pages should be of use.
On Sat, 01 Dec 2001 22:21:31 xsprite@bigfoot.com wrote:
on Sat, Dec 01, 2001 at 08:43:26PM +0000, Paul wrote:
I have a linux box running RH6.x that I want to have booting directly in to X-windows without having to log in first. The various network services still need to be started so that I can telnet in - Question is, in what order are the start up scripts run, and which one(s) do I need to hack to skip the login ?
The login is in two parts. The login: prompt is caused by getty, which is launched by init on the correct tty. The password: prompt is from /bin/login. I think roothat uses mingetty. inittab will tell you.
Or better still, where can I find documents on the boot sequence ?
inittab(5), init(8) man pages should be of use.
Have you tried the Linux documentation project http://www.linuxdoc.org?
As Xsprite points out, init is the key to it all. When the kernel has finished initialising it starts init, init reads the inittab file and starts whatever is configured there. Usually init is at /sbin/init and inittab at /etc/inittab.
The init program has the concept of run levels (usually 6 of them). A run level is supposed to correspond to a particular level of service from the system and in practice trabslates to a set of programs that will be running in that run level.
In most unix systems the inittab file has init run one shell script once when the system is first booted to do any hardware check and maybe check filesystems and then for each run level it will use a shell script to startup all the programs that should be running in that run level and kill of those that shouldn't. This is done through a series of directories called something like /etc/rd1.d /etc/rc2.d etc (numbered after the run levels). The exact place is distro specific but IIRC redhat has these in /etc/init.d/rc1.d etc.
Each of these run level directories contains symolic links to shell scripts. Those links whose names start with an S are for programs to start and those that start with a K are for programs to kill. These links are processed in normal filename sorting order so the filename often encode numbers to force the order of execution. The actual shell scripts themselve are usually in /etc/init.d (sometimes /sbin/init.d) and each is called with a single command line argument 'start' when involed via it's 'S' link and 'stop' when invoked via it's 'K' link.
These shell scripts are used to start everything from network service to an X based graphical login. The useful thing about them is a that a package can install on of these scripts and its links when the package is installed and remove them when the package is remove without affecting the rest of the system startup.
When the appropriate /etc/rc?.d scripts have been run init then starts gettty etc as specified by inittab.
Now on to the X window system. In a typical X session there is an X server process which manages the hardware, a session manager which controls startup and shutdown of other programs, a window manager doing window placement, window focus etc, and the client applications. X can be started twio ways, either as a graphical login or once someone has logged in the text mode.
For the graphical login a graphical login manager is used which starts from one of those /etc/rc?.d scripts. I know of three xdm (pure X11), gdm (Gnome) and kdm (KDE). These all tend to work on the same lines. A master process starts an X server on those pieces of graphics hardware (vt's in Linux) it has been told to and then on each X display available to it (can include remote ones) it starts a graphical login process. The graphical login process authenticates the user then starts the session manager. The session manager starts the window manager and other client applications.
For no graphical login, the user's normal login profile detects that the hardware is capable of running X and calls a shell script to set up an X session (something like 'startx'). The shell script in turn calls xinit which starts the X server and the session manager. The session manager starts the window manager and the client apps.
So, to get an X session without authentication there are a couple of options:
1. Read the documentation on a graphical login manager like 'gdm'. I know, for example, that gdm supports 'auto login' so maybe one of the others do too.
2. Write a wrapper around the 'startx' script which can then be places in one of the /etc/rc?.d directories to run as a standard system service.
I hope that helps. Steve.
Hi Steve
Thanks for the additional info on the boot scripts.
If the application is written in Tcl/Tk (as mine is) or Qt, then it is not necessary to start X with a window manager. For example : xinit -e /usr/X11R6/bin/xterm - Fires up X with a single x-terminal. Run this from one of the rc.d scripts (thank xsprite) , and you don't even need to login. This is fine as long as just one X-app is required or the program can spawn additional windows.
Regards, Paul.
On Saturday 01 December 2001 11:58 pm, Steve Fosdick wrote:
So, to get an X session without authentication there are a couple of options:
- Read the documentation on a graphical login manager like 'gdm'. I
know, for example, that gdm supports 'auto login' so maybe one of the others do too.
- Write a wrapper around the 'startx' script which can then be places in
one of the /etc/rc?.d directories to run as a standard system service.
Thanks for the pointers - Kiosk-HOWTO also provided some usefull info. I now have linux booting straight in to my X-app and shutting down on quitting. Just need to decide on which services are essential, and which ones are wasting space. Network services will be needed, whilst gpm can be dumped along with random and cron.
Regards, Paul.
On Saturday 01 December 2001 10:21 pm, xsprite@bigfoot.com wrote:
The login is in two parts. The login: prompt is caused by getty, which is launched by init on the correct tty. The password: prompt is from /bin/login. I think roothat uses mingetty. inittab will tell you.
Or better still, where can I find documents on the boot sequence ?
inittab(5), init(8) man pages should be of use.
On Sat, Dec 01, 2001 at 11:56:58PM +0000, Paul wrote:
Thanks for the pointers - Kiosk-HOWTO also provided some usefull info. I now have linux booting straight in to my X-app and shutting down on quitting. Just need to decide on which services are essential, and which ones are wasting space. Network services will be needed, whilst gpm can be dumped along with random and cron.
Uh. I really wouldn't recommend ditching cron. It's used for all kinds of things, most of which you won't want to stop doing just because you're using X.