README for init/getty/login, by poe@daimi.aau.dk

This package contains init, getty, and login programs for Linux.
Additional utilities included are: hostname, who, write, wall, users and mesg.

Most of this software has been contributed by others, I basically just
ported the things to Linux.

This is version 1.6 (29-Aug-92): changes since 1.5:
	This is for Linux 0.97P1+ or later.
	
	Login now uses the newly implemented vhangup() sys-call, to prevent
	snooping on the tty.
	An alternative getpass() function is now provided with login, because
	I was told that the old one in libc didn't work with telnet and
	or rlogin. I don't have a network or a kernel with TCP/IP so I haven't
	tested the new one with telnet, but it is derived from BSD sources
	that are supposed to work with networking.

Version 1.5 (12-Aug-92): changes since 1.4
	This is for Linux 0.97 or later, and has been built with gcc2.2.2

	This release just puts in a few bugfixes in login.c and simpleinit.c

Version 1.4 (4-Jul-92): changes since 1.3:
	This is for Linux 0.96b, and has been built and tested with gcc 2.2.2.

	Init now handles the SIGINT signal. When init gets a SIGINT it will
	call /usr/bin/reboot and thereby gently reboot the machine. This
	makes sense because after Linux 0.96B-PL1 the key-combination
	Ctrl-Alt-Del may send a SIGINT to init instead of booting the 
	machine the hard way without syncing or anything.

	You may want to get the admutils-1.1 package which includes a program
	that will instruct the kernel to use the "gentle-reboot" procedure.

Version 1.3 (14-Jun-92): changes since 1.2:
	This is for Linux 0.96A.

	The ioctl(TIOCSWINSZ) has been removed from login.c because it now
	works :-).
	
	login.c now supports a lastlog database.

	Several programs and pieces of source that were included in the 1.2
	package has been *removed* as they are incorporated into the new
	libc. Other omitted parts such as last(1) has been replaced by
	better versions, and can be found in the admutils package.

	Agetty is now called getty and will be placed in /etc.

	A few changes has been made to make it possible to compile the
	stuff with GCC 2.x.

Version 1.2 (28-Feb-92): changes since 1.1:
	This is for Linux 0.12.

	A couple of problems with simpleinit.c has been solved, thanks to
	Humberto Zuazaga. So now init groks comments in /etc/inittab, and
	handles the HUP and TSTP signals properly.

	I added two small scripts to the distribution: users and mesg.

	TERM is now carried through from /etc/inittab all the way to the
	shell. Console tty's are special-cased, so the termcap entry in
	/etc/inittab is overridden by the setting given at boot-time.
	This requires a different patch to the kernel than that distributed
	with version 1.1

	Login no more sends superfluous chars from a password to the 
	shell. It also properly prints a NL after the password.

	Agetty didn't set the erase character properly, it does now.

	A few extra defines has been added to utmp.h

	Several netters helped discover the bugs in 1.1. Thanks to them
	all.

Version 1.1 (released 19-Feb-92): Changes since 1.0:
	A bug in simpleinit.c has been fixed, thanks to Pietro Castelli.
	The definition of the ut_line field has been changed to track the
	USG standard more closely, we now strip "/dev/" off the front.
	Thanks to: Douglas E. Quale and Stephen Gallimore.

	I have added a getlogin.c library routine, and a write(1) command.
	I removed the qpl-init stuff. If people want to use it, they should
	get it from the source. I don't want to hack on it anymore.

	A couple of people reported problems with getty having problems 
	with serial terminals. That was correct. I borrowed a null-modem
	from Tommy Thorn, and now the problems should be fixed. It seems
	that there is kept a lot of garbage in the serial buffers, flush
	them and it works like a charm. Getty does an ioctl(0, TCFLSH, 2)
	for this.

	The write.c code now doubles as code for a wall(1) program.

Description of the various files:

login.c		The login program. This is a portation of BSD login, first
		to HP-UX 8.0 by Michael Glad (glad@daimi.aau.dk), and
		to Linux by me.

who.c		A simple who(1) util. to list utmp. Done by me.

hostname.c	A hostname(1) command to get and set the hostname. I did
		this too.

agetty.c	The getty program. From comp.sources.misc, by W.Z. Venema.
		Hacked a bit by me.

simpleinit.c	A simple init program, written by me. Uses /etc/inittab

		Beware that RUN_RC is already defined in simpleinit.c. If
		you don't want this, remove the #define.
		A "kill -HUP" to init makes it re-read /etc/inittab.
		A "kill -TSTP" to init makes it stop spawning gettys on the
		ttys. A second "kill -TSTP" starts it again.

		If you want or need a real Sys V compatible init with
		run-levels and all, get the admutils package from your
		favourite ftp-site.

write.c		A write(1) command, used to pass messages between users
		at different terminals. This code doubles as code for 
		a wall(1) command. Make a symlink: /usr/bin/wall ->
		/usr/bin/write for this.

mesg		A tiny shellscript, so you can avoid that other people write
		to your shell.

users		Another script that uses awk(1) and tr(1) to process the
		output from who(1) into a one-liner.
		If you don't have awk, but have Perl, this does the same:

		who | perl -ane 'print "$F[0] "'; echo ""

pathnames.h:
		Header.

param.h
		Header, extended with getdtablesize() macro, should go
		in /usr/include/sys

Building.
---------
A "make all" should do. At least it does for me.

Installation:
-------------

login		should go in /bin, if you don't like this change
		pathnames.h and recompile at least agetty.

getty, init	Put them in /etc.

who, hostname, write, wall, mesg, users:
		/usr/bin

securetty	login needs this in /etc, defines which ttys that root
		can login on. This should *never* include ttys{1,2}

inittab		the simpleinit code needs this in /etc. Note that the syntax
		of /etc/inittab has little to do with the syntax of a real
		SysV inittab. Edit this one for your local setup.

shells		The chsh program will use this if it's placed in /etc. It
		defines the valid shell-programs. Have one abs. path on
		each line.

You can also do a "make install" as root, but don't just do it because I
say so, check the Makefile first.

Getty requires a /dev/console to write errors to. I just made it a symlink
to /dev/tty1. Because of a bug in the tty driver this errorlogging may
cause the shell on tty1 to logout.

Getty will print the contents of /etc/issue if it's present before asking
for username. Login will print the contents of /etc/motd after successful
login. Login doesn't print /etc/motd, and doesn't check for mail if
~/.hushlogin is present and world readable.

If /etc/nologin is present then login will print its contents and disallow
any logins except root.
It might be a good idea to have a "rm -f /etc/nologin" line in one's 
/etc/rc file.

If /etc/securetty is present it defines which tty's that root can login on.

   - Peter (poe@daimi.aau.dk)
