aboutsummaryrefslogtreecommitdiff
path: root/riemann.fmi.uni-sofia.bg/ngetty/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'riemann.fmi.uni-sofia.bg/ngetty/index.html')
-rw-r--r--riemann.fmi.uni-sofia.bg/ngetty/index.html307
1 files changed, 307 insertions, 0 deletions
diff --git a/riemann.fmi.uni-sofia.bg/ngetty/index.html b/riemann.fmi.uni-sofia.bg/ngetty/index.html
new file mode 100644
index 0000000..4e53767
--- /dev/null
+++ b/riemann.fmi.uni-sofia.bg/ngetty/index.html
@@ -0,0 +1,307 @@
+<html>
+<link rel="stylesheet" type="text/css" href="style.css">
+<title>ngetty</title>
+<body>
+
+<div class="top">
+<ul class="nav">
+ <li><a href="all.html">All files</a>
+</ul>
+
+<h1>ngetty - one daemon for all virtual consoles</h1>
+<div class="endtop"></div>
+</div>
+
+<table>
+<ul>
+<td>
+<li>
+ <a href=/ngetty/old/ngetty-1.0.tar.gz>
+ ngetty-1.0.tar.gz</a> (old)
+</li><li>
+ <a href=/ngetty/ngetty-1.1.tar.gz>
+ ngetty-1.1.tar.gz</a> (stable)
+</li><li>
+ <a href=all.html>Index</a>
+</li>
+</ul>
+
+</td><td>
+<ul>
+<li>
+ Manual <a href=/ngetty/ngetty.man> page</a>
+</li><li>
+ Other <a href=/ngetty/pr_other.html> programs</a>
+</li><li>
+ Binary <a href=/ngetty/binary/> packages</a>
+</li>
+</ul>
+
+</td><td>
+<ul>
+<li>
+ Recent <a href=News.txt>news</a>
+</li><li>
+ Security <a href=guarantee.html>guarantee</a>
+</li>
+</ul>
+</td>
+
+</table>
+
+<h2>About</h2>
+<b>ngetty</b> is a daemon that starts login sessions on virtual console
+terminals, on demand. It is a good replacement for all those getty
+processes started from init that, most of the time, are only taking up
+memory. When compiled statically with dietlibc, the ngetty binary
+size is only about 2k and uses considerably less
+<a href="pr_other.html#Memory">memory</a>
+than a getty. See pstree <a href=ps_tree>here</a>.
+<a name="Resources">
+<pre>
+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 4
+</pre>
+</a>
+
+Ngetty is designed to stop including <b>getty-like</b> code
+in init programs.
+<br>
+I used source and ideas from
+<a href=http://sites.google.com/site/anbadeol/logind>logind</a>.
+Many thanks, Andre!
+
+<p>
+<a name=List>
+There is a
+&#109;&#97;&#105;&#108;&#105;&#110;&#103;&#32;&#108;&#105;&#115;&#116;
+for ngetty. To &#115;&#117;&#98;&#115;&#99;&#114;&#105;&#98;&#101;&#44;
+send an empty &#109;&#101;&#115;&#115;&#97;&#103;&#101;
+to <br>
+<font size=+1>
+<a href=
+&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#110;&#103;&#101;&#116;&#116;&#121;&#45;&#115;&#117;&#98;&#115;&#99;&#114;&#105;&#98;&#101;&#64;&#114;&#105;&#101;&#109;&#97;&#110;&#110;&#46;&#102;&#109;&#105;&#46;&#117;&#110;&#105;&#45;&#115;&#111;&#102;&#105;&#97;&#46;&#98;&#103;
+>
+&#110;&#103;&#101;&#116;&#116;&#121;&#45;&#115;&#117;&#98;&#115;&#99;&#114;&#105;&#98;&#101;&#64;&#114;&#105;&#101;&#109;&#97;&#110;&#110;&#46;&#102;&#109;&#105;&#46;&#117;&#110;&#105;&#45;&#115;&#111;&#102;&#105;&#97;&#46;&#98;&#103;
+</a>
+</font>
+</a>
+<br>
+Some delay is possible due to
+&#103;&#114;&#101;&#121;&#108;&#105;&#115;&#116;&#105;&#110;&#103;&#46;
+
+<h2>Benefits</h2>
+<ul>
+<li>
+ one process (instead of many) using
+ minimal <a href="#Resources">resources</a>
+</li><li>
+ work with different <a href="#Login">login</a> applications
+<br>
+ can start any program with arbitrary arguments
+</li><li>
+ easy to start by
+ <a href="#Init_d"><tt>init.d</tt></a>
+or
+ <a href="#Inittab"><tt>/etc/inittab</tt></a><br>
+ easy to start by other <a href="#Init">init</a> systems
+</li><li>
+ makes <b>utmp/wtmp</b> records<br>
+ no need of <b>ngetty</b>-monitoring by some other process
+</li><li>
+ easy to setup modifying <tt>/etc/ngetty/Conf[.sed]</tt>
+</li><li>
+ modular (<tt>ngetty-helper</tt> and
+ <tt>ngetty-argv</tt>)
+</li><li>
+ easy to upgrade <tt>ngetty-helper</tt><br>
+ <tt>cp /path/to/new/ngetty-helper /sbin</tt>
+</li><li>
+ uses minimal <tt>libc</tt> library functions<br>
+ easy to build by
+ <a href=http://www.fefe.de/dietlibc/>dietlibc</a> -
+ <tt>make CC='diet -Os gcc'</tt>
+</li><li>
+ small code size with <a href=guarantee.html>security</a> guarantee
+<li>
+</ul>
+
+<h2>Install</h2>
+Ready to use binary packages are
+<a href=binary/>here</a>.
+I prepared them using
+<pre>
+ make package CC='diet -Os gcc -W'
+ make rpm
+</pre>
+
+If you have
+<a href=http://www.fefe.de/dietlibc/>
+dietlibc</a> already installed do
+<pre>
+ 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_other
+</pre>
+To compile <tt>ngetty</tt> with glibc skip <tt>CC=...</tt> above.
+<pre>
+ make
+ make install
+</pre>
+It is possible to do also
+<pre>
+ make dietbuild
+ make install
+</pre>
+Last 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 <a href=pr_other.html>here</a>.
+
+<h2>Post install</h2>
+Browse the files: <tt>/etc/ngetty/Conf[.sed], /etc/ngetty/sample.Conf</tt>
+<br>
+<a name="Init_d">
+Execute <tt>./init.d/ngetty start</tt></a>
+<br>
+If all is right you'll have working terminals on
+<br>
+<tt>/dev/tty{8|9|10}</tt> or <tt>/dev/vc/{8|9|10}</tt>
+<br>
+Try to login/logout on some of them.
+<p>
+ Some logins requires the TTY variable. Set it in
+ <tt>/etc/ngetty/Conf</tt>.
+ How to do this see the
+<a href=ngetty.man>manual</a> page of ngetty. Examples:
+<pre>
+ tty4=environ=,TERM=linux,TTY=/dev/tty4
+ tty5=environ=,TERM=linux,TTY=/dev/tty5
+ tty6=environ=,TERM=linux,TTY=/dev/tty6
+</pre>
+If you can login in the system then
+you can make ngetty default.
+</br>
+You have to edit
+<tt>/etc/inittab</tt> file.
+<p>
+Do this in two steps. Fist comment default getty on
+<tt>tty{4|5|6}</tt>
+<br>
+and edit
+<tt>/etc/inittab</tt> like next:
+<pre>
+ 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 6
+</pre>
+If your <tt>/etc/inittab</tt> 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 <tt>tty{4|5|6}</tt>.
+<p>
+<a name=Inittab>
+If it is successful change <tt>/etc/inittab</tt></a>
+like:
+<pre>
+ # 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 6
+</pre>
+and reboot again.
+<br>
+That's all. You will have one ngetty instead of six
+<tt>{a|f|min}getty</tt>.
+<br>
+If <tt>ngetty</tt> is compiled with dietlibc it will use 16k RAM only.
+<p>
+<font color=red>WARNING</font>:
+May be it's possible to make all without reboot. I don't use
+<tt>/sbin/init</tt> and don't know how to do this. The manual page
+<b>init</b>(8) says to use <tt>kill -HUP 1</tt>
+
+
+<h2><a name="Init">Using ngetty with other init systems</a></h2>
+If you use
+<a href=http://www.fefe.de/minit/>minit</a> or
+<a href=/ninit/>ninit</a> you have
+to make one new service <tt>ngetty</tt>, include it in
+<br>
+<tt>default/depends</tt> and comment running <tt>getty</tt>
+there.
+<p>
+The preparation of service <tt>ngetty</tt> is simple:
+<pre>
+ 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 run
+</pre>
+You can use ngetty also with <a href=http://smarden.org/runit/>runit</a>.
+Start it as ordinary service. Since ngetty does utmp/wtmp records there
+is no need ot any additional setup.
+
+<h2><a name="Login">Using ngetty with other logins</a></h2>
+Ngetty uses the deafult <tt>/bin/login</tt> program.
+It's easy to use another login also.
+<br>
+My login program is
+<a href=/programs/nlogin-0.3-pre.tar.gz>here</a>.
+Copy it to <tt>/bin/nlogin</tt> and add in
+<tt>/etc/ngetty/Conf</tt>
+<pre>
+=login-prog=/bin/nlogin
+</pre>
+
+It's possible to start any program with arbitrary arguments using
+<tt>ngetty-argv</tt> helper.
+<br>
+To use ngetty with <a href=http://www.fefe.de/fgetty/>fgetty</a>
+logins add in <tt>/etc/ngetty/Conf</tt>
+<pre>
+=echo-off
+=login-prog=/bin/login1
+ on debian system replace login1 with fgetty-login
+</pre>
+
+I still use
+startx script with my <a href=/programs/xinit.c>xinit.c</a>.
+
+<p>
+<hr>
+
+Author: Nikola Vladov
+<p>
+Send comments and suggestions using
+ngetty
+<a
+href=#List>&#109;&#97;&#105;&#108;&#105;&#110;&#103;&#45;&#108;&#105;&#115;&#116;</a>
+or
+<a href=/email.html>qform</a>.
+<p>
+Last modified: 26 May 2010.
+<br>
+Some <a href=comments.txt>comments</a> about ngetty.
+</body>
+</html>