commit 98729b21efc51e2fadd4e4c00eb912b141f226e3
parent c121c0bacf07a05ef38284f0db994e83dc5e077c
Author: Gerrit Pape <pape@smarden.org>
Date: Tue, 1 Jan 2002 15:28:32 +0000
install-man integrated.
Diffstat:
7 files changed, 139 insertions(+), 76 deletions(-)
diff --git a/debian/postinst b/debian/postinst
@@ -25,7 +25,7 @@ set -e
case "$1" in
configure)
( \
- cd /package/admin/runit-0.2.6
+ cd /package/admin/runit-0.2.7
package/upgrade
)
;;
diff --git a/debian/rules b/debian/rules
@@ -23,22 +23,22 @@ build-stamp:
# $(MAKE)
#/usr/bin/docbook-to-man debian/runit.sgml > runit.1
- tar xfzvp runit-0.2.6.tar.gz
- mkdir -p admin/runit-0.2.6/compile
+ tar xfzvp runit-0.2.7.tar.gz
+ mkdir -p admin/runit-0.2.7/compile
tar xfzvp daemontools-pd-0.76.tar.gz \
- -C admin/runit-0.2.6/compile
+ -C admin/runit-0.2.7/compile
( \
- cd admin/runit-0.2.6/compile ; \
+ cd admin/runit-0.2.7/compile ; \
ln -s daemontools-pd-0.76 support ; \
echo 'diet gcc -O2 -Wall' > support/conf-cc ; \
echo 'diet gcc -s -Os -pipe' > support/conf-ld ; \
)
( \
- cd admin/runit-0.2.6 ; \
+ cd admin/runit-0.2.7 ; \
package/compile ; \
- echo "/package/admin/runit-0.2.6" > compile/home ; \
+ echo "/package/admin/runit-0.2.7" > compile/home ; \
rm -f compile/src ; \
- ln -s /package/admin/runit-0.2.6/src compile/src ; \
+ ln -s /package/admin/runit-0.2.7/src compile/src ; \
)
touch build-stamp
@@ -65,40 +65,40 @@ install: build
chmod 1755 debian/runit/package
cp -a admin debian/runit/package/
- rm -rf debian/runit/package/admin/runit-0.2.6/compile
- cp -a debian/runit/package/admin/runit-0.2.6/man .
- rm -rf debian/runit/package/admin/runit-0.2.6/man
- cp -a debian/runit/package/admin/runit-0.2.6/doc .
- rm -rf debian/runit/package/admin/runit-0.2.6/doc
- cp -a debian/runit/package/admin/runit-0.2.6/etc .
- rm -rf debian/runit/package/admin/runit-0.2.6/etc
- cp -a debian/runit/package/admin/runit-0.2.6/package .
+ rm -rf debian/runit/package/admin/runit-0.2.7/compile
+ cp -a debian/runit/package/admin/runit-0.2.7/man .
+ rm -rf debian/runit/package/admin/runit-0.2.7/man
+ cp -a debian/runit/package/admin/runit-0.2.7/doc .
+ rm -rf debian/runit/package/admin/runit-0.2.7/doc
+ cp -a debian/runit/package/admin/runit-0.2.7/etc .
+ rm -rf debian/runit/package/admin/runit-0.2.7/etc
+ cp -a debian/runit/package/admin/runit-0.2.7/package .
# /etc/runit
- cp -p admin/runit-0.2.6/etc/debian/[123] \
+ cp -p admin/runit-0.2.7/etc/debian/[123] \
debian/runit/etc/runit/
- cp -p admin/runit-0.2.6/etc/debian/ctrlaltdel \
+ cp -p admin/runit-0.2.7/etc/debian/ctrlaltdel \
debian/runit/etc/runit/
- cp -p admin/runit-0.2.6/etc/debian/getty-tty5/run \
+ cp -p admin/runit-0.2.7/etc/debian/getty-tty5/run \
debian/runit/etc/runit/getty-tty5
# runit programs
- cp -p debian/runit/package/admin/runit-0.2.6/command/runit* \
+ cp -p debian/runit/package/admin/runit-0.2.7/command/runit* \
debian/runit/sbin/
# cleanup
- rm -rf debian/runit/package/admin/runit-0.2.6/compile
+ rm -rf debian/runit/package/admin/runit-0.2.7/compile
# create debian/links
rm -f debian/links
for i in \
- `cat debian/runit/package/admin/runit-0.2.6/package/commands` ; \
+ `cat debian/runit/package/admin/runit-0.2.7/package/commands` ; \
do \
echo "/package/admin/runit/command/$$i /command/$$i" \
>> debian/links ; \
done
# for i in \
-# `cat debian/runit/package/admin/runit-0.2.6/package/commands` ; \
+# `cat debian/runit/package/admin/runit-0.2.7/package/commands` ; \
# do \
# echo "/command/$$i /usr/local/bin/$$i" \
# >> debian/links ; \
diff --git a/doc/index.html b/doc/index.html
@@ -12,27 +12,30 @@
<a href="replaceinit.html">How to replace init</a><br>
<a href="usedietlibc.html">How to use dietlibc</a>
<p>
-<a href="runscripts.html">A collection of run scripts</a>
+<a href="runscripts.html">A collection of run scripts</a><br>
+<a href="http://smarden.org/pape/djb/daemontools/noinit.html">
+Dependencies and runlevels</a>
<p>
<a href="runit.8.html">The <tt>runit</tt> program</a><br>
<a href="runit-init.8.html">The <tt>runit-init</tt> program</a><br>
<a href="svwaitdown.8.html">The <tt>svwaitdown</tt> program</a><br>
<a href="svwaitup.8.html">The <tt>svwaitup</tt> program</a>
<hr>
-<i>runit</i> cooperates with djb's
+<i>runit</i> cooperates with the
<a href="http://cr.yp.to/daemontools.html">daemontools</a> package to create
a replacement for
<a href="ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/">sysvinit</a>.
<i>runit</i> currently runs on
-<a href="http://www.debian.org">Debian GNU/Linux</a> and
-<a href="http://www.openbsd.org/">OpenBSD 2.9<a> but may be easily
+<a href="http://www.debian.org/">Debian GNU/Linux sid/woody</a>,
+<a href="http://www.openbsd.org/">OpenBSD 2.9</a>,
+<a href="http://www.freebsd.org/">FreeBSD 4.4</a> and can easily be
adapted to other unix operating systems. If <i>runit</i> runs for
you on any other operating system or linux distribution, please let me know.
<p>
-<b>Warning:</b> Replacing <i>sysvinit</i> can cause the system's boot to fail.
-Make sure you are able to recover and repair your system, for example if you
-run a boot loader, it should be able to pass <tt>init=/bin/sh</tt> to the
-kernel.
+<b>Warning:</b> Replacing <i>sysvinit</i> or <i>init</i> can cause the
+system's boot to fail. Make sure you are able to recover and repair your
+system, for example if you run a boot loader, it should be able to pass
+<tt>init=/bin/sh</tt> to the kernel.
<hr>
The command <a href="runit.8.html">runit</a> is intended to run as Unix
process no 1, it is automatically started by the
@@ -50,8 +53,8 @@ if this is started by the kernel.
until the system is going to halt or reboot, if it crashes, it will be
restarted. Normally, <tt>/etc/runit/2</tt> runs
<a href="http://cr.yp.to/daemontools/svscanboot.html">svscanboot</a>.
- In Stage 2, <i>runit</i> is able to handle the ctrl-alt-del keyboard
- request.
+ In Stage 2 <i>runit</i> optionally handles an INT signal
+ (ctrl-alt-del keyboard request on i386).
<li><b>Stage 3:</b><br>
If <i>runit</i> is told to halt or reboot the system, or the Stage 2
returns without errors, it terminates Stage 2 if it is running and runs
@@ -63,10 +66,11 @@ These are working examples for debian woody:
<a href="debian/2">/etc/runit/2</a>,
<a href="debian/3">/etc/runit/3</a>.
<p>
-The command <a href="runit-init.8.html">runit-init</a> is intended to replace
-<tt>/sbin/init</tt>. sysvinit's command <tt>shutdown</tt> will keep working.
-Runlevels are not implemented in this Unix process no 1, such can easily be
-done in other programs, see
+The command <a href="runit-init.8.html">runit-init</a> is intended to
+replace <tt>/sbin/init</tt>. sysvinit's command <tt>shutdown</tt> will
+keep working. On *BSD systems use <b><tt>init 0</tt></b> for system halt
+and <b><tt>init 6</tt></b> for reboot. Runlevels are not implemented in
+this Unix process no 1, such can easily be done in other programs, see
<a href="http://smarden.org/pape/djb/daemontools/noinit.html">
Dependencies and runlevels</a>
for an example, the amount of code in process no 1 should be minimal.
@@ -89,6 +93,20 @@ I recommend doing this; for instructions, see
See <a href="http://smarden.org/runit/">http://smarden.org/runit/</a>
for recent informations.
<hr>
+Related links:
+<ul>
+ <li><a href="http://www.fefe.de/minit/">minit</a>
+ <li><a href="http://multivac.cwru.edu/svscan-1/">svscan as process 1</a>
+ <li><a href="ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/">
+ sysvinit</a>
+ <li><a href="http://www.openbsd.org/cgi-bin/cvsweb/src/sbin/init/">
+ OpenBSD's init</a>
+ <li><a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sbin/init/">
+ FreeBSD's init</a>
+ <li><a href="http://www.atnf.csiro.au/~rgooch/linux/boot-scripts/">
+ Richard Gooch's Linux Boot Scripts</a>
+</ul>
+<hr>
<address><a href="mailto:pape@smarden.org">
Gerrit Pape <pape@smarden.org>
</a></address>
diff --git a/doc/install.html b/doc/install.html
@@ -13,27 +13,23 @@ Check that you have the recent version of
<a href="http://cr.yp.to/daemontools.html">daemontools</a> installed.
<p>
Download
-<a href="runit-0.2.6.tar.gz">runit-0.2.6.tar.gz</a> into <tt>/package</tt>
+<a href="runit-0.2.7.tar.gz">runit-0.2.7.tar.gz</a> into <tt>/package</tt>
and unpack the archive
<pre>
# cd /package
- # gunzip runit-0.2.6.tar
- # tar -xpf runit-0.2.6.tar
- # rm runit-0.2.6.tar
- # cd admin/runit-0.2.6
+ # gunzip runit-0.2.7.tar
+ # tar -xpf runit-0.2.7.tar
+ # rm runit-0.2.7.tar
+ # cd admin/runit-0.2.7
</pre>
Compile and install the <i>runit</i> programs
<pre>
# package/install
</pre>
-gzip the man pages and copy them into a reasonable directory in your
-<tt>$MANPATH</tt>, e.g.
+If you want to make the man pages available in the <tt>/usr/local/man/</tt>
+hierarchy, do:
<pre>
- # mkdir -p /usr/local/man/man8/
- # gzip man/runit.8 && cp -f man/runit.8.gz /usr/local/man/man8/
- # gzip man/runit-init.8 && cp -f man/runit-init.8.gz /usr/local/man/man8/
- # gzip man/svwaitdown.8 && cp -f man/svwaitdown.8.gz /usr/local/man/man8/
- # gzip man/svwaitup.8 && cp -f man/svwaitup.8.gz /usr/local/man/man8/
+ # package/install-man
</pre>
Refer to <a href="replaceinit.html">replacing init</a> for
replacing <i>init</i> with <i>runit</i>.
diff --git a/doc/replaceinit.html b/doc/replaceinit.html
@@ -9,10 +9,10 @@
<hr>
<h1>runit - replacing init</h1>
<hr>
-<a href="#sysvinit">How to replace sysvinit on Linux</a><br>
-<a href="#bsdinit">How to replace init on OpenBSD</a>
+<a href="#sysvinit">How to replace sysvinit on GNU/Linux</a><br>
+<a href="#bsdinit">How to replace init on *BSD</a>
<hr>
-<a name="sysvinit"><h2>Replacing sysvinit (Linux)</h2></a>
+<a name="sysvinit"><h2>Replacing sysvinit (GNU/Linux)</h2></a>
Follow these steps to migrate from <i>sysvinit</i> to <i>runit</i> on
<a href="http://www.debian.org/releases/woody/">Debian GNU/Linux (woody)</a>.
The <tt>/sbin/init</tt> binary is not replaced until step 6, <i>runit</i> is
@@ -29,8 +29,8 @@ If you have installed the precompiled debian package, start at step 3.
</pre>
Create also a getty service directory:
<pre>
- # mkdir -p /etc/runit/getty-tty5
- # cp -p /package/admin/runit/etc/debian/getty-tty5/run /etc/runit/getty-tty5
+ # mkdir -p /etc/runit/getty-5
+ # cp -p /package/admin/runit/etc/debian/getty-tty5/run /etc/runit/getty-5/
</pre>
If you want <i>runit</i> to handle the ctrl-alt-del keyboard request, do:
<pre>
@@ -47,9 +47,9 @@ At least one getty must run in stage 2 so you are able to login, choose a
free <tt>tty</tt>, say <tt>tty5</tt>, where <i>sysvinit</i> is not running
any getty (edit <tt>/etc/inittab</tt> and <tt>kill -HUP 1</tt> if
needed) and tell <a href="http://cr.yp.to/daemontools/svscan.html">svscan</a>
-about the getty-tty5 <i>service</i>:
+about the getty-5 <i>service</i>:
<pre>
- # ln -s /etc/runit/getty-tty5 /service/
+ # ln -s /etc/runit/getty-5 /service/
</pre>
Check if the getty is running.
<h3>Step 4: Reboot into runit for testing</h3>
@@ -107,13 +107,14 @@ default Unix process no 1 <i>runit</i>.
</pre>
To report success:
<pre>
- # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.2.6@smarden.org
+ # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.2.7@smarden.org
</pre>
<hr>
-<a name="bsdinit"><h2>Replacing init (OpenBSD)</h2></a>
+<a name="bsdinit"><h2>Replacing init (*BSD)</h2></a>
Follow these steps to migrate from <i>init</i> to <i>runit</i> on
-<a href="http://www.openbsd.org/">OpenBSD 2.9</a>. The
+<a href="http://www.openbsd.org/">OpenBSD 2.9</a> or
+<a href="http://www.freebsd.org/">FreeBSD 4.4</a>. The
<tt>/sbin/init</tt> binary is not replaced until step 4.
<h3>Step 1: The three stages</h3>
<i>runit</i> looks for the three stages implementing the system's
@@ -121,7 +122,12 @@ Follow these steps to migrate from <i>init</i> to <i>runit</i> on
<tt>/etc/runit/2</tt> and <tt>/etc/runit/3</tt>, create the files now:
<pre>
# mkdir -p /etc/runit
+
+OpenBSD 2.9:
# cp -p /package/admin/runit/etc/openbsd/[123] /etc/runit/
+
+FreeBSD 4.4:
+ # cp -p /package/admin/runit/etc/freebsd/[123] /etc/runit/
</pre>
Remove the <tt>svscanboot</tt> startup from <tt>/etc/rc.local</tt> by
deleting the line <tt>csh -cf '/command/svscanboot &'</tt> (this normally
@@ -130,12 +136,6 @@ after running <tt>rc.local</tt> in stage 1.
<pre>
# vi /etc/rc.local
</pre>
-Create also a getty service directory:
-<pre>
- # mkdir -p /etc/runit/getty-ttyC4
- # cp -p /package/admin/runit/etc/openbsd/getty-ttyC4/run \
- /etc/runit/getty-ttyC4
-</pre>
<h3>Step 2: The runit programs</h3>
The <i>runit</i> programs must reside on the root partition, install them
into <tt>/sbin</tt>:
@@ -143,12 +143,24 @@ into <tt>/sbin</tt>:
# install -m0500 /package/admin/runit/command/runit* /sbin/
</pre>
<h3>Step 3: The getties</h3>
-At least one getty must run in stage 2 so you are able to login, choose a
-local <tt>tty</tt>, say <tt>ttyC4</tt> and tell
+At least one getty must run in stage 2 so you are able to login. To have it
+run on the virtual console no 5, create the getty-5 service directory:
+<pre>
+ # mkdir -p /etc/runit/getty-5
+
+OpenBSD 2.9:
+ # cp -p /package/admin/runit/etc/openbsd/getty-ttyC4/run \
+ /etc/runit/getty-5/
+
+FreeBSD 4.4:
+ # cp -p /package/admin/runit/etc/freebsd/getty-ttyv4/run \
+ /etc/runit/getty-5/
+</pre>
+and tell
<a href="http://cr.yp.to/daemontools/svscan.html">svscan</a>
-about the <tt>getty-ttyC4</tt> <i>service</i>:
+about the <tt>getty-5</tt> <i>service</i>:
<pre>
- # ln -s /etc/runit/getty-ttyC4 /service/
+ # ln -s /etc/runit/getty-5 /service/
</pre>
<h3>Step 4: Replace the <tt>/sbin/init</tt> binary</h3>
Before replacing the <tt>init</tt> binary, make sure that you are able
@@ -166,8 +178,8 @@ Boot your system with <i>runit</i> for the first time:
# reboot
</pre>
Watch the console output while <i>runit</i> boots up the system. Switch
-to ttyC4 (CTRL-ALT-F5) when stage 2 is reached, a getty should run there,
-you are able to login.
+to the virtual console 5 (CTRL-ALT-F5) when stage 2 is reached, a getty
+should run there, you are able to login.
<p>
Use <b>init 6</b> to reboot and <b>init 0</b> to halt a system that runs
<i>runit</i>. This will cause <i>runit</i> to enter stage 3 which runs
@@ -175,7 +187,7 @@ Use <b>init 6</b> to reboot and <b>init 0</b> to halt a system that runs
<p>
To report success:
<pre>
- # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.2.6@smarden.org
+ # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.2.7@smarden.org
</pre>
<h3>Step 5: Service migration</h3>
The goal is to migrate all services from <i>/etc/rc.*</i> scheme to the
@@ -194,10 +206,9 @@ services are started automatically:
exit 0
</pre>
To migrate a service, create a service directory, disable the service if
-it is running, remove the service startup from the <tt>/etc/rc.*</tt>
-script and tell <tt>svscan</tt> about the new service.
-
-
+it is running, disable the service in <tt>/etc/rc.conf</tt> or remove the
+service startup from the <tt>/etc/rc.*</tt> scripts and tell <tt>svscan</tt>
+about the new service.
<hr>
<address><a href="mailto:pape@smarden.org">
Gerrit Pape <pape@smarden.org>
diff --git a/package/CHANGES b/package/CHANGES
@@ -1,3 +1,13 @@
+runit 0.2.7
+Tue, 1 Jan 2002 16:20:14 +0100
+ * tested on fresh freebsd 4.4 installation in vmware
+ * new etc/freebsd: stages and getty service
+ * doc: replaceinit: how to replace bsd init (freebsd)
+ * svwaitup: minor code cleanup
+ * doc: /service/getty-5/ as default getty service.
+ * doc: index: related links added.
+ * package: install-man added for installing manpages in /usr/local/man/
+
runit 0.2.6
Sun, 30 Dec 2001 17:29:29 +0100
* runs on openbsd 2.9
diff --git a/package/install-man b/package/install-man
@@ -0,0 +1,28 @@
+#!/bin/sh -e
+
+umask 022
+test -d package || ( echo 'Wrong working directory.'; exit 1 )
+test -d man || ( echo 'Wrong working directory.'; exit 1 )
+
+here=`env - PATH=$PATH pwd`
+parent=`dirname $here`
+
+echo 'Compressing manpages...'
+for i in man/*.[1-8]
+do
+ gzip -c $i > ${i}.gz
+done
+
+echo 'Making manpage links in /usr/local/man...'
+cd man
+for i in 8
+do
+ mkdir -p /usr/local/man/man$i
+ for j in *.$i
+ do
+ rm -f /usr/local/man/man$i/$j.gz'{new}'
+ ln -s $parent/runit/man/$j.gz /usr/local/man/man$i/$j.gz'{new}'
+ mv -f /usr/local/man/man$i/$j.gz'{new}' /usr/local/man/man$i/$j.gz
+ done
+done
+cd ..