commit df0425bc0127fbd164b30fc8574280b1f8e5f0e2
parent 8835d3f940b40c10baef7009993915c439dcdebe
Author: Gerrit Pape <pape@smarden.org>
Date: Fri, 24 Jan 2003 14:18:11 +0000
* runsv.c: close finish script file descriptor.
* runsv.c: close logpipe[] instead of sending sigterm to logservice when
told to exit, loggers should exit when they see EOF on stdin (thx Paul
Jarc).
* etc/*/1, etc/*/3: remove explicit 'exit'.
* error.h: include <errno.h> (upcoming glibc changes).
0.8.2.
Diffstat:
20 files changed, 138 insertions(+), 105 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,6 +1,6 @@
DESTDIR=
-PACKAGE=runit-0.7.1
+PACKAGE=runit-0.7.2
DIRS=doc man etc package src
MANPAGES=runit.8 runit-init.8 runsvdir.8 runsv.8 svwaitdown.8 svwaitup.8 \
utmpset.8 runsvchdir.8 runsvstat.8 runsvctrl.8
@@ -15,6 +15,8 @@ all: clean .manpages $(PACKAGE).tar.gz
s}<!--.*-->}}g' \
> doc/$$i.html ; \
done ; \
+ echo 'fix up html manually...'
+ sh
touch .manpages
$(PACKAGE).tar.gz:
diff --git a/debian/changelog b/debian/changelog
@@ -1,3 +1,9 @@
+runit (0.7.2-1) unstable; urgency=low
+
+ * new upstream version.
+
+ -- Gerrit Pape <pape@smarden.org> Thu, 16 Jan 2003 10:50:14 +0100
+
runit (0.7.1-5) unstable; urgency=low
* debian/3: stop getties after all other services.
diff --git a/debian/rules b/debian/rules
@@ -26,10 +26,11 @@ build-arch-stamp:
# Add here command to compile/build the package.
# $(MAKE)
- tar xfzvp runit-0.7.1.tar.gz
+ tar xfzvp runit-0.7.2.tar.gz
( \
- cd admin/runit-0.7.1/src; \
- ln -s runit-0.7.1 runit; mv runit ../..; \
+ set -e; \
+ cd admin/runit-0.7.2/src; \
+ ln -s runit-0.7.2 runit; mv runit ../..; \
echo 'diet -v -Os gcc -O2 -Wall' >conf-cc; \
echo 'diet -v -Os gcc -s -Os -pipe' >conf-ld; \
$(MAKE); \
@@ -73,26 +74,26 @@ install: build
# $(MAKE) install DESTDIR=$(CURDIR)/debian/runit
# runit
- install -m0500 admin/runit-0.7.1/src/runit \
+ install -m0500 admin/runit-0.7.2/src/runit \
$(CURDIR)/debian/runit/sbin/runit
- install -m0500 admin/runit-0.7.1/src/runit-init \
+ install -m0500 admin/runit-0.7.2/src/runit-init \
$(CURDIR)/debian/runit/sbin/runit-init
- install -m0755 admin/runit-0.7.1/src/runsvdir \
+ install -m0755 admin/runit-0.7.2/src/runsvdir \
$(CURDIR)/debian/runit/usr/bin/runsvdir
- install -m0755 admin/runit-0.7.1/src/runsv \
+ install -m0755 admin/runit-0.7.2/src/runsv \
$(CURDIR)/debian/runit/usr/bin/runsv
- install -m0755 admin/runit-0.7.1/src/runsvchdir \
+ install -m0755 admin/runit-0.7.2/src/runsvchdir \
$(CURDIR)/debian/runit/usr/sbin/runsvchdir
- install -m0755 admin/runit-0.7.1/src/svwaitdown \
+ install -m0755 admin/runit-0.7.2/src/svwaitdown \
$(CURDIR)/debian/runit/usr/bin/svwaitdown
- install -m0755 admin/runit-0.7.1/src/svwaitup \
+ install -m0755 admin/runit-0.7.2/src/svwaitup \
$(CURDIR)/debian/runit/usr/bin/svwaitup
- install -m0755 admin/runit-0.7.1/src/utmpset \
+ install -m0755 admin/runit-0.7.2/src/utmpset \
$(CURDIR)/debian/runit/usr/sbin/utmpset
- install -m0755 admin/runit-0.7.1/src/runsvstat \
+ install -m0755 admin/runit-0.7.2/src/runsvstat \
$(CURDIR)/debian/runit/usr/bin/runsvstat
- install -m0755 admin/runit-0.7.1/src/runsvctrl \
+ install -m0755 admin/runit-0.7.2/src/runsvctrl \
$(CURDIR)/debian/runit/usr/bin/runsvctrl
install -m0700 debian/1 \
@@ -125,7 +126,7 @@ binary-arch: build install
# dh_installexamples -a
dh_installman -a admin/runit/man/*.8
# dh_undocumented -a
- dh_installchangelogs -a admin/runit-0.7.1/package/CHANGES
+ dh_installchangelogs -a admin/runit-0.7.2/package/CHANGES
dh_strip -a
# dh_link -a
dh_compress -a
diff --git a/doc/index.html b/doc/index.html
@@ -38,11 +38,11 @@ Dependencies</a><br>
<a href="http://cr.yp.to/daemontools.html">daemontools</a> alike
replacement for
<a href="ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/">sysvinit</a>
-and other init schemes. <i>runit</i> runs on <b>Debian GNU/Linux</b>,
-<b>OpenBSD 2.9</b>, <b>FreeBSD 4.4</b>. <i>runit</i> reportedly runs on
-<b>FreeBSD 4.3</b>, 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.
+and other init schemes. <i>runit</i> runs on <b>GNU/Linux</b>,
+<b>OpenBSD</b>, <b>FreeBSD</b>, 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> or <i>init</i> can cause the
system's boot to fail. Make sure you are able to recover and repair your
@@ -110,61 +110,63 @@ and potato, and did not encounter any problems. Of course also the
no 1, here is an example:
<pre>
# strings /proc/1/exe |grep Id
- $Id$
+ $Id: runit.c,v 1.7 2002/02/13 09:59:52 pape Exp $
# uptime
- 11:32:18 up 25 days, 18:29, 2 users, load average: 0.12, 0.03, 0.01
- # ps axuw |head -n14
+ 14:36:29 up 88 days, 1:51, 2 users, load average: 0.20, 0.13, 0.04
+ # ps axuw |head -n20
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
- root 1 0.0 0.0 20 20 ? S Sep27 0:06 runit
- root 2 0.0 0.0 0 0 ? SW Sep27 0:00 [kflushd]
- root 3 0.0 0.0 0 0 ? SW Sep27 0:00 [kupdate]
- root 4 0.0 0.0 0 0 ? SW Sep27 0:04 [kswapd]
- root 5 0.0 0.0 0 0 ? SW Sep27 0:00 [keventd]
- root 153 0.0 1.0 1652 676 ? S Sep27 0:00 /usr/sbin/cron
- root 156 0.0 0.0 40 28 ? S Sep27 0:00 runsvdir /service log: .......................................................
- root 157 0.0 0.0 24 24 ? S Sep27 0:00 runsv socklog-unix
- root 158 0.0 0.0 24 24 ? S Sep27 0:00 runsv qmail-smtpd
- root 159 0.0 0.0 24 24 ? S Sep27 0:00 runsv qmail-send
- root 160 0.0 0.0 24 24 ? S Sep27 0:00 runsv sshd
- root 161 0.0 0.0 24 24 ? S Sep27 0:00 runsv getty-tty2
- root 162 0.0 0.0 24 24 ? S Sep27 0:00 runsv getty-tty3
- # pstree
- runit-+-cron
+ root 1 0.0 0.0 20 16 ? S 2002 0:05 runit
+ root 2 0.0 0.0 0 0 ? SW 2002 0:00 [keventd]
+ root 3 0.0 0.0 0 0 ? SWN 2002 0:00 [ksoftirqd_CPU0]
+ root 4 0.0 0.0 0 0 ? SW 2002 0:16 [kswapd]
+ root 5 0.0 0.0 0 0 ? SW 2002 0:00 [bdflush]
+ root 6 0.0 0.0 0 0 ? SW 2002 0:01 [kupdated]
+ root 168 0.0 0.2 1652 584 ? S 2002 0:00 /usr/sbin/cron
+ root 174 0.0 0.0 36 24 ? S 2002 0:00 runsvdir /service log: ........................................................................................................
+ root 176 0.0 0.0 20 20 ? S 2002 0:00 runsv qmail-send
+ root 177 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-5
+ root 178 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-4
+ root 179 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-3
+ root 180 0.0 0.0 20 20 ? S 2002 0:00 runsv getty-2
+ root 181 0.0 0.0 20 20 ? S 2002 0:00 runsv qmail-smtpd
+ root 182 0.0 0.0 20 20 ? S 2002 0:00 runsv socklog-unix
+ root 183 0.0 0.1 1256 384 tty5 S 2002 0:00 getty 38400 tty5 linux
+ root 184 0.0 0.1 1256 384 tty3 S 2002 0:00 getty 38400 tty3 linux
+ root 185 0.0 0.0 20 20 ? S 2002 0:00 runsv socklog-klog
+ root 186 0.0 0.0 20 20 ? S 2002 0:00 runsv ssh
+# pstree
+ runit-+-bdflush
+ |-cron
|-keventd
- |-kflushd
+ |-ksoftirqd_CPU0
|-kswapd
- |-kupdate
- `-runsvdir-+-2*[runsv-+-multilog]
- | `-socklog]
- |-5*[runsv-+-multilog]
- | `-tcpserver]
- |-runsv-+-multilog
+ |-kupdated
+ `-runsvdir-+-runsv-+-multilog
| `-qmail-send-+-qmail-clean
| |-qmail-lspawn
| `-qmail-rspawn
+ |-4*[runsv---getty]
|-runsv-+-multilog
- | `-sshd-+-sshd---sshd---bash---bash---ssh
- | `-sshd---sshd---bash---bash---pstree
- |-3*[runsv---getty]
- |-runsv---uncat
- |-runsv-+-dhcpd-2.2.x
- | `-multilog
- |-runsv-+-dnscache
- | `-multilog
- |-runsv-+-multilog
- | `-tinydns
- |-runsv-+-isdnlog
- | `-multilog
- |-runsv---klogd
- |-runsv---multilog
+ | `-tcpserver---qmail-smtpd
|-2*[runsv-+-multilog]
- | `-vboxgetty]
+ | `-socklog]
+ |-runsv-+-multilog
+ | `-sshd-+-2*[sshd---sshd---tail]
+ | |-sshd---sshd---bash
+ | `-sshd---sshd---bash---bash---pstree
|-runsv---clockspeed
- |-runsv-+-dhclient-2.2.x
+ |-runsv-+-dnscache
| `-multilog
- `-runsv---squid---unlinkd
+ |-runsv---apache-ssl-+-20*[apache-ssl]
+ | |-gcache
+ | `-4*[multilog]
+ |-6*[runsv-+-multilog]
+ | `-tcpserver]
+ |-3*[runsv-+-multilog]
+ | `-tinydns]
+ `-runsv---uncat
</pre>
-This is a more busy system:
+This is from a more busy system:
<pre>
# strings /proc/1/exe |grep Id
$Id: runit.c,v 1.6 2002/01/29 18:56:36 pape Exp $
@@ -189,11 +191,11 @@ smoothly escaping from <i>sysvinit</i>.
<hr>
If <i>runit</i> on linux is compiled and linked with
<a href="http://www.fefe.de/dietlibc/">dietlibc</a> it yields in a statically
-linked <tt>runit</tt> binary of 14k size and this <tt>ps axuw</tt> output
+linked <tt>runit</tt> binary of 9.7k size and this <tt>ps axuw</tt> output
on my system:
<pre>
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
- root 1 0.0 0.0 24 20 ? S Nov22 0:01 runit
+ root 1 0.0 0.0 20 16 ? S 2002 0:02 runit
</pre>
I recommend doing this; for instructions, see
<a href="usedietlibc.html">How to use dietlibc</a>.
diff --git a/doc/install.html b/doc/install.html
@@ -13,14 +13,14 @@ 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.7.1.tar.gz">runit-0.7.1.tar.gz</a> into <tt>/package</tt>
+<a href="runit-0.7.2.tar.gz">runit-0.7.2.tar.gz</a> into <tt>/package</tt>
and unpack the archive
<pre>
# cd /package
- # gunzip runit-0.7.1.tar
- # tar -xpf runit-0.7.1.tar
- # rm runit-0.7.1.tar
- # cd admin/runit-0.7.1
+ # gunzip runit-0.7.2.tar
+ # tar -xpf runit-0.7.2.tar
+ # rm runit-0.7.2.tar
+ # cd admin/runit-0.7.2
</pre>
Compile and install the <i>runit</i> programs
<pre>
diff --git a/doc/replaceinit.html b/doc/replaceinit.html
@@ -107,7 +107,7 @@ default Unix process no 1 <i>runit</i>.
</pre>
To report success:
<pre>
- # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.7.1@smarden.org
+ # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.7.2@smarden.org
</pre>
<hr>
@@ -188,7 +188,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.7.1@smarden.org
+ # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.7.2@smarden.org
</pre>
<h3>Step 5: Service migration</h3>
The goal is to migrate all services from <i>/etc/rc.*</i> scheme to the
diff --git a/doc/runscripts.html b/doc/runscripts.html
@@ -27,7 +27,7 @@ them monitored by the
<a href="http://cr.yp.to/daemontools.html">daemontools</a> package. If you
have additional run scripts or one of these run scripts works for you on
an operating system not stated here, please
-<a href="mailto:pape@smarden.org">let me know</a>.
+<a href="mailto:pape-runscripts@smarden.org">let me know</a>.
<p>
Thanks go to the following people for contributing run scripts:
Alessandro Bono (a.bono).
diff --git a/doc/runsv.8.html b/doc/runsv.8.html
@@ -71,9 +71,15 @@ send it a HUP signal. </DD>
signal. </DD>
<DT><B>i</B> </DT>
-<DD>Interrupt. If the service is running, send it a INT signal. </LI><B></B><LI>User-defined
-1. If the service is running, send it a USR1 signal. </LI><B></B><LI>User-defined 2. If the
-service is running, send it a USR2 signal. </DD>
+<DD>Interrupt. If the service is running, send it a INT signal. </DD>
+
+<DT><B>1</B> </DT>
+<DD>User-defined 1.
+If the service is running, send it a USR1 signal. </DD>
+
+<DT><B>2</B> </DT>
+<DD>User-defined 2.
+If the service is running, send it a USR2 signal. </DD>
<DT><B>t</B> </DT>
<DD>Terminate. If the service is
diff --git a/doc/runsvctrl.8.html b/doc/runsvctrl.8.html
@@ -54,9 +54,15 @@ is running, send it a ALRM signal. </DD>
<DT><B>interrupt</B> </DT>
<DD>If the service is running,
-send it a INT signal. </LI><B></B><LI>User-defined 1. If the service is running, send it a
-USR1 signal. </LI><B></B><LI>User-defined 2. If the service is running, send it a USR2 signal.
-</DD>
+send it a INT signal. </DD>
+
+<DT><B>1</B> </DT>
+<DD>User-defined 1.
+If the service is running, send it a USR1 signal. </DD>
+
+<DT><B>2</B> </DT>
+<DD>User-defined 2.
+If the service is running, send it a USR2 signal. </DD>
<DT><B>term</B> </DT>
<DD>If the service is running, send it a TERM signal. </DD>
diff --git a/doc/upgrade.html b/doc/upgrade.html
@@ -10,7 +10,7 @@
<h1>runit - upgrading from previous versions</h1>
<hr>
-<h3>0.6.0 to 0.7.0 or 0.7.1</h3>
+<h3>0.6.0 to 0.7.0 or 0.7.1 or 0.7.2</h3>
This version introduces runlevel support with the new
<a href="runsvchdir.8.html">runsvchdir</a> program. See the
<a href="runlevels.html">runlevels documentation</a> for more information.
diff --git a/etc/debian/1 b/etc/debian/1
@@ -1,8 +1,7 @@
#!/bin/sh
# system one time tasks
-rm -f /etc/runit/stopit
+
/etc/init.d/rcS
+rm -f /etc/runit/stopit
/etc/init.d/rmnologin
-
-exit 0
diff --git a/etc/debian/3 b/etc/debian/3
@@ -14,5 +14,3 @@ svwaitdown -xk -t350 /service/*
echo 'Shutdown...'
/etc/init.d/rc $LAST
-
-exit 0
diff --git a/etc/freebsd/1 b/etc/freebsd/1
@@ -10,5 +10,3 @@ echo '/etc/rc failed. Press <enter> for emergency shell...'
read input
/bin/sh -p
/sbin/reboot
-
-exit
diff --git a/etc/freebsd/3 b/etc/freebsd/3
@@ -12,5 +12,3 @@ if test -r /etc/runit/reboot; then
else
exec halt
fi
-
-exit 0
diff --git a/etc/openbsd/1 b/etc/openbsd/1
@@ -10,5 +10,3 @@ echo '/etc/rc failed. Press <enter> for emergency shell...'
read input
/bin/sh -l
/sbin/reboot
-
-exit
diff --git a/etc/openbsd/3 b/etc/openbsd/3
@@ -15,5 +15,3 @@ if test -r /etc/runit/reboot; then
else
exec halt
fi
-
-exit 0
diff --git a/package/CHANGES b/package/CHANGES
@@ -1,3 +1,12 @@
+runit 0.7.2
+Fri, 10 Jan 2003 21:34:13 +0100
+ * runsv.c: close finish script file descriptor.
+ * runsv.c: close logpipe[] instead of sending sigterm to logservice when
+ told to exit, loggers should exit when they see EOF on stdin (thx Paul
+ Jarc).
+ * etc/*/1, etc/*/3: remove explicit 'exit'.
+ * error.h: include <errno.h> (upcoming glibc changes).
+
runit 0.7.1
Wed, 23 Oct 2002 11:40:24 +0200
* man/runsv.8, doc/runlevels.html: typos.
diff --git a/package/upgrade b/package/upgrade
@@ -7,9 +7,9 @@ test -d src || ( echo 'Wrong working directory.'; exit 1 )
here=`env - PATH=$PATH pwd`
parent=`dirname $here`
-echo 'Creating symlink runit -> runit-0.7.1...'
+echo 'Creating symlink runit -> runit-0.7.2...'
rm -f runit
-ln -s runit-0.7.1 runit
+ln -s runit-0.7.2 runit
mv -f runit ..
echo 'Making command links in /command...'
diff --git a/src/error.h b/src/error.h
@@ -3,7 +3,10 @@
#ifndef ERROR_H
#define ERROR_H
-extern int errno;
+/* 20030124: include <errno.h> -upcoming glibc changes */
+#include <errno.h>
+
+/* extern int errno; */
extern int error_intr;
extern int error_nomem;
diff --git a/src/runsv.c b/src/runsv.c
@@ -214,7 +214,7 @@ void stopservice(struct svdir *s) {
void startservice(struct svdir *s) {
int p;
char *run[2];
-
+
if (s->state == S_FINISH)
run[0] ="./finish";
else
@@ -232,12 +232,14 @@ void startservice(struct svdir *s) {
if (s->islog) {
if (fd_copy(0, logpipe[0]) == -1)
fatal("unable to setup filedescriptor for ./log/run");
+ close(logpipe[1]);
if (chdir("./log") == -1)
- fatal("unable to change directory ./log");
+ fatal("unable to change directory to ./log");
}
else {
if (fd_copy(1, logpipe[1]) == -1)
fatal("unable to setup filedescriptor for ./run");
+ close(logpipe[0]);
}
}
sig_uncatch(sig_child);
@@ -349,6 +351,7 @@ int main(int argc, char **argv) {
svd[0].ctrl =C_NOOP;
svd[0].want =W_UP;
svd[0].islog =0;
+ svd[1].pid =0;
taia_now(&svd[0].start);
if (stat("down", &s) != -1)
svd[0].want =W_DOWN;
@@ -362,7 +365,6 @@ int main(int argc, char **argv) {
warnx("./log: not a directory.");
else {
haslog =1;
- svd[1].pid =0;
svd[1].state =S_DOWN;
svd[1].ctrl =C_NOOP;
svd[1].want =W_UP;
@@ -458,12 +460,14 @@ int main(int argc, char **argv) {
if (child == svd[0].pid) {
svd[0].pid =0;
pidchanged =1;
- if ((svd[0].state != S_FINISH) && (open_read("finish") != -1)) {
- svd[0].state =S_FINISH;
- startservice(&svd[0]);
- update_status(&svd[0]);
- break;
- }
+ if (svd[0].state != S_FINISH)
+ if ((fd =open_read("finish")) != -1) {
+ close(fd);
+ svd[0].state =S_FINISH;
+ startservice(&svd[0]);
+ update_status(&svd[0]);
+ break;
+ }
svd[0].state =S_DOWN;
svd[0].ctrl &=~C_TERM;
taia_now(&svd[0].start);
@@ -499,7 +503,12 @@ int main(int argc, char **argv) {
exit(0);
if (svd[1].want != W_EXIT) {
svd[1].want =W_EXIT;
+ /*
stopservice(&svd[1]);
+ */
+ update_status(&svd[1]);
+ if (close(logpipe[1]) == -1) warn("unable to close logpipe[1]");
+ if (close(logpipe[0]) == -1) warn("unable to close logpipe[0]");
}
}
}