From 2208761ba51953b772d78bb99229abeb5cf2231b Mon Sep 17 00:00:00 2001 From: Gerrit Pape Date: Tue, 17 Jun 2003 13:48:35 +0000 Subject: * runit.c: user select() on systems that don't provide poll() (builds on Mac OSX). * svlogd.c: reset match flag in lineflush() in all cases. * Makefile: build setuidgid in default target. * doc/useinit.html: add instruction to create /etc/runit/2 first. * doc/install.html: minor. 0.9.5. --- Makefile | 7 +++++-- debian/rules | 36 ++++++++++++++++++------------------ doc/index.html | 3 ++- doc/install.html | 14 +++++++++----- doc/replaceinit.html | 4 ++-- doc/upgrade.html | 2 +- doc/useinit.html | 7 +++++++ etc/2 | 6 ++++++ etc/debian/2 | 6 ------ etc/freebsd/2 | 6 ------ etc/openbsd/2 | 6 ------ package/CHANGES | 9 +++++++++ package/upgrade | 4 ++-- src/Makefile | 2 +- src/runit.c | 14 +++++++++++--- src/svlogd.c | 1 + 16 files changed, 74 insertions(+), 53 deletions(-) create mode 100755 etc/2 delete mode 100755 etc/debian/2 delete mode 100755 etc/freebsd/2 delete mode 100755 etc/openbsd/2 diff --git a/Makefile b/Makefile index b0e677b..72e079c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ DESTDIR= -PACKAGE=runit-0.9.4 +PACKAGE=runit-0.9.5 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 svlogd.8 @@ -16,7 +16,7 @@ all: clean .manpages $(PACKAGE).tar.gz > doc/$$i.html ; \ done ; \ echo 'fix up html manually...' - echo 'patch -p0 conf-cc; \ echo "$(CC) $(LDFLAGS)" >conf-ld; \ $(MAKE); \ @@ -80,35 +80,35 @@ install: build dh_installdirs # runit - install -m0500 admin/runit-0.9.4/src/runit \ + install -m0500 admin/runit-0.9.5/src/runit \ $(CURDIR)/debian/runit/sbin/runit - install -m0500 admin/runit-0.9.4/src/runit-init \ + install -m0500 admin/runit-0.9.5/src/runit-init \ $(CURDIR)/debian/runit/sbin/runit-init - install -m0755 admin/runit-0.9.4/src/runsvdir \ + install -m0755 admin/runit-0.9.5/src/runsvdir \ $(CURDIR)/debian/runit/usr/bin/runsvdir - install -m0755 admin/runit-0.9.4/src/runsv \ + install -m0755 admin/runit-0.9.5/src/runsv \ $(CURDIR)/debian/runit/usr/bin/runsv - install -m0755 admin/runit-0.9.4/src/runsvchdir \ + install -m0755 admin/runit-0.9.5/src/runsvchdir \ $(CURDIR)/debian/runit/usr/sbin/runsvchdir - install -m0755 admin/runit-0.9.4/src/svlogd \ + install -m0755 admin/runit-0.9.5/src/svlogd \ $(CURDIR)/debian/runit/usr/bin/svlogd - install -m0755 admin/runit-0.9.4/src/svwaitdown \ + install -m0755 admin/runit-0.9.5/src/svwaitdown \ $(CURDIR)/debian/runit/usr/bin/svwaitdown - install -m0755 admin/runit-0.9.4/src/svwaitup \ + install -m0755 admin/runit-0.9.5/src/svwaitup \ $(CURDIR)/debian/runit/usr/bin/svwaitup - install -m0755 admin/runit-0.9.4/src/utmpset \ + install -m0755 admin/runit-0.9.5/src/utmpset \ $(CURDIR)/debian/runit/usr/sbin/utmpset - install -m0755 admin/runit-0.9.4/src/runsvstat \ + install -m0755 admin/runit-0.9.5/src/runsvstat \ $(CURDIR)/debian/runit/usr/bin/runsvstat - install -m0755 admin/runit-0.9.4/src/runsvctrl \ + install -m0755 admin/runit-0.9.5/src/runsvctrl \ $(CURDIR)/debian/runit/usr/bin/runsvctrl - install -m0755 admin/runit-0.9.4/src/setuidgid \ + install -m0755 admin/runit-0.9.5/src/setuidgid \ $(CURDIR)/debian/runit/usr/sbin/setuidgid - install -m0755 admin/runit-0.9.4/etc/debian/getty-tty5/run \ + install -m0755 admin/runit-0.9.5/etc/debian/getty-tty5/run \ $(CURDIR)/debian/runit/etc/runit/getty-5/run - install -m0755 admin/runit-0.9.4/etc/debian/getty-tty5/finish \ + install -m0755 admin/runit-0.9.5/etc/debian/getty-tty5/finish \ $(CURDIR)/debian/runit/etc/runit/getty-5/finish # lintian overrides @@ -147,7 +147,7 @@ binary-arch: build install # dh_installdocs -an # dh_installexamples -a dh_installman -a admin/runit/man/*.8 - dh_installchangelogs -a admin/runit-0.9.4/package/CHANGES + dh_installchangelogs -a admin/runit-0.9.5/package/CHANGES dh_strip -a # dh_link -a dh_compress -a diff --git a/doc/index.html b/doc/index.html index 80f03e9..2e9eb8f 100644 --- a/doc/index.html +++ b/doc/index.html @@ -41,7 +41,8 @@ replacement for sysvinit and other init schemes. runit runs on GNU/Linux, -OpenBSD, FreeBSD, and can easily be adapted to other unix +OpenBSD, FreeBSD, Mac OSX, and can easily be adapted +to other unix operating systems. If runit runs for you on any other operating system or Linux distribution, please let me know. diff --git a/doc/install.html b/doc/install.html index eedc169..27ce591 100644 --- a/doc/install.html +++ b/doc/install.html @@ -17,14 +17,14 @@ If you don't have a /package directory, create it now: # chmod 1755 /package Download -runit-0.9.4.tar.gz into /package +runit-0.9.5.tar.gz into /package and unpack the archive
   # cd /package
-  # gunzip runit-0.9.4.tar
-  # tar -xpf runit-0.9.4.tar
-  # rm runit-0.9.4.tar
-  # cd admin/runit-0.9.4
+  # gunzip runit-0.9.5.tar
+  # tar -xpf runit-0.9.5.tar
+  # rm runit-0.9.5.tar
+  # cd admin/runit-0.9.5
 
Compile and install the runit programs
@@ -35,6 +35,10 @@ hierarchy, do:
 
   # package/install-man
 
+To report success: +
+  # mail pape-runit-0.9.5@smarden.org <compile/sysdeps
+
Refer to replacing init for replacing init with runit, or to use with traditional init for running diff --git a/doc/replaceinit.html b/doc/replaceinit.html index c8f8565..44bed23 100644 --- a/doc/replaceinit.html +++ b/doc/replaceinit.html @@ -107,7 +107,7 @@ default Unix process no 1 runit.
To report success:
-  # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.9.4@smarden.org
+  # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.9.5@smarden.org
 

@@ -188,7 +188,7 @@ Use init 6 to reboot and init 0 to halt a system that runs

To report success:

-  # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.9.4@smarden.org
+  # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.9.5@smarden.org
 

Step 5: Service migration

The goal is to migrate all services from /etc/rc.* scheme to the diff --git a/doc/upgrade.html b/doc/upgrade.html index bc20888..18691d7 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -10,7 +10,7 @@

runit - upgrading from previous versions


-

0.8.0 or 0.8.1 to 0.9.1 or 0.9.4

+

0.8.0 or 0.8.1 to 0.9.x

The svlogd program is new. svlogd is a service logging daemon designed to be run from log/run files, similar to diff --git a/doc/useinit.html b/doc/useinit.html index 37c4123..1450608 100644 --- a/doc/useinit.html +++ b/doc/useinit.html @@ -17,6 +17,13 @@ current init. Normally this is done by either adding /etc/runit/2 as command to /etc/rc.local, or by adding an entry for /etc/runit/2 to /etc/inittab. +

+In either case, you first need to copy the stage 2 script to +/etc/runit/2: +

+  # mkdir -p /etc/runit
+  # cp -p /package/admin/runit/etc/2 /etc/runit/
+

If your system uses a sysvinit alike init scheme with a /etc/inittab file, do: diff --git a/etc/2 b/etc/2 new file mode 100755 index 0000000..666a643 --- /dev/null +++ b/etc/2 @@ -0,0 +1,6 @@ +#!/bin/sh + +PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin + +exec env - PATH=$PATH \ +runsvdir /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' diff --git a/etc/debian/2 b/etc/debian/2 deleted file mode 100755 index 666a643..0000000 --- a/etc/debian/2 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin - -exec env - PATH=$PATH \ -runsvdir /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' diff --git a/etc/freebsd/2 b/etc/freebsd/2 deleted file mode 100755 index 666a643..0000000 --- a/etc/freebsd/2 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin - -exec env - PATH=$PATH \ -runsvdir /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' diff --git a/etc/openbsd/2 b/etc/openbsd/2 deleted file mode 100755 index 666a643..0000000 --- a/etc/openbsd/2 +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -PATH=/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin - -exec env - PATH=$PATH \ -runsvdir /service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................' diff --git a/package/CHANGES b/package/CHANGES index 0bc209f..951c769 100644 --- a/package/CHANGES +++ b/package/CHANGES @@ -1,3 +1,12 @@ +runit 0.9.5 +Tue, 17 Jun 2003 10:48:10 +0200 + * runit.c: user select() on systems that don't provide poll() (builds + on Mac OSX). + * svlogd.c: reset match flag in lineflush() in all cases. + * Makefile: build setuidgid in default target. + * doc/useinit.html: add instruction to create /etc/runit/2 first. + * doc/install.html: minor. + runit 0.9.4 Wed, 04 Jun 2003 13:56:33 +0200 * svlogd.c: default log file size is 1M; print verbose message only if diff --git a/package/upgrade b/package/upgrade index e310a25..745fdad 100755 --- 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.9.4...' +echo 'Creating symlink runit -> runit-0.9.5...' rm -f runit -ln -s runit-0.9.4 runit +ln -s runit-0.9.5 runit mv -f runit .. echo 'Making command links in /command...' diff --git a/src/Makefile b/src/Makefile index a027310..3a3788a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,5 @@ IT=sysdeps runit runit-init runsv runsvctrl runsvstat runsvdir runsvchdir \ -svwaitup svwaitdown utmpset svlogd +svwaitup svwaitdown utmpset svlogd setuidgid default: $(IT) diff --git a/src/runit.c b/src/runit.c index 5637d75..225333a 100644 --- a/src/runit.c +++ b/src/runit.c @@ -1,5 +1,3 @@ -#include - #include #include #include @@ -48,6 +46,9 @@ int main (int argc, const char * const *argv, char * const *envp) { int wstat; int st; iopause_fd x; +#ifndef IOPAUSE_POLL + fd_set rfds; +#endif char ch; int ttyfd; struct stat s; @@ -135,14 +136,21 @@ int main (int argc, const char * const *argv, char * const *envp) { x.fd =selfpipe[0]; x.events =IOPAUSE_READ; - +#ifndef IOPAUSE_POLL + FD_ZERO(&rfds); + FD_SET(x.fd, &rfds); +#endif for (;;) { int child; sig_unblock(sig_child); sig_unblock(sig_cont); sig_unblock(sig_int); +#ifdef IOPAUSE_POLL poll(&x, 1, -1); +#else + select(x.fd +1, &rfds, (fd_set*)0, (fd_set*)0, (struct timeval*)0); +#endif sig_block(sig_cont); sig_block(sig_child); sig_block(sig_int); diff --git a/src/svlogd.c b/src/svlogd.c index 37015ba..d77a938 100644 --- a/src/svlogd.c +++ b/src/svlogd.c @@ -456,6 +456,7 @@ unsigned int lineadd(struct logdir *ld, char *s, int len) { unsigned int lineflush(struct logdir *ld, char *s, int len) { switch(ld->match) { case '-': + ld->match =0; return(0); case 0: linestart(ld, s, len); -- cgit 1.4.1