|
|
riemann$ ps uww -C ngetty USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 145 0.0 0.0 8 8 ? Ss Jan05 0:00 ngetty 1 2 3 4Ngetty is designed to stop including getty-like code in init programs.
There is a
mailing list
for ngetty. To subscribe,
send an empty message
to
ngetty-subscribe@riemann.fmi.uni-sofia.bg
Some delay is possible due to
greylisting.
make package CC='diet -Os gcc -W' make rpmIf you have dietlibc already installed do
wget http://riemann.fmi.uni-sofia.bg/ngetty/ngetty-1.1.tar.gz gzip -dc ngetty-1.1.tar.gz | tar -xv cd ngetty-1.1 # Read the ngetty.8 manual page (man ./ngetty.8) # Browse lib.h (check if the LOGIN path is correct!) # Edit Makefile to taste make CC='diet -Os gcc -W' make install # If you want to install some additional programs do: make install_otherTo compile ngetty with glibc skip CC=... above.
make make installIt is possible to do also
make dietbuild make installLast download and install dietlibc in current dir and then compile ngetty. It takes 1-2 minutes to build dietlibc (depends on how fast ist your CPU). See also here.
Some logins requires the TTY variable. Set it in /etc/ngetty/Conf. How to do this see the manual page of ngetty. Examples:
tty4=environ=,TERM=linux,TTY=/dev/tty4 tty5=environ=,TERM=linux,TTY=/dev/tty5 tty6=environ=,TERM=linux,TTY=/dev/tty6If you can login in the system then you can make ngetty default. You have to edit /etc/inittab file.
Do this in two steps. Fist comment default getty on
tty{4|5|6}
and edit
/etc/inittab like next:
1:2345:respawn:/sbin/mingetty tty1 2:2345:respawn:/sbin/mingetty tty2 3:2345:respawn:/sbin/mingetty tty3 # 4:2345:respawn:/sbin/mingetty tty4 # 5:2345:respawn:/sbin/mingetty tty5 # 6:2345:respawn:/sbin/mingetty tty6 # Run ngetty in standard run-levels ng:2345:respawn:/sbin/ngetty 4 5 6If your /etc/inittab have different entries only comment the last three of them and add two lines for ngetty as above. Now it's time to reboot the computer. After the reboot try to login/logout on tty{4|5|6}.
If it is successful change /etc/inittab like:
# 1:2345:respawn:/sbin/mingetty tty1 # 2:2345:respawn:/sbin/mingetty tty2 # 3:2345:respawn:/sbin/mingetty tty3 # 4:2345:respawn:/sbin/mingetty tty4 # 5:2345:respawn:/sbin/mingetty tty5 # 6:2345:respawn:/sbin/mingetty tty6 # Run ngetty in standard run-levels ng:2345:respawn:/sbin/ngetty 1 2 3 4 5 6and reboot again.
WARNING: May be it's possible to make all without reboot. I don't use /sbin/init and don't know how to do this. The manual page init(8) says to use kill -HUP 1
The preparation of service ngetty is simple:
mkdir /etc/ninit/ngetty cd /etc/ninit/ngetty ( echo '' ; echo TERM=linux ) > environ ( for f in 1 2 3 4 5 6 ; do echo $f ; done ) > params ln -s /sbin/ngetty runYou can use ngetty also with runit. Start it as ordinary service. Since ngetty does utmp/wtmp records there is no need ot any additional setup.
=login-prog=/bin/nloginIt's possible to start any program with arbitrary arguments using ngetty-argv helper.
=echo-off =login-prog=/bin/login1 on debian system replace login1 with fgetty-loginI still use startx script with my xinit.c.
Send comments and suggestions using ngetty mailing-list or qform.
Last modified: 26 May 2010.
Some comments about ngetty.