commit 19d2897dccece6b2d572e05c0bd1ec805eb35cc1
parent a06efb293d27a7b8639de8a23eccce57238fb40c
Author: Gerrit Pape <pape@smarden.org>
Date: Mon, 24 Jun 2002 14:09:47 +0000
* utmpset.c: new option -w: additionally write wtmp record.
0.4.1.
Diffstat:
11 files changed, 68 insertions(+), 39 deletions(-)
diff --git a/Makefile b/Makefile
@@ -1,6 +1,6 @@
DESTDIR=
-PACKAGE=runit-0.4.0
+PACKAGE=runit-0.4.1
DIRS=doc man etc package src
MANPAGES=man/runit.8 man/runit-init.8 man/svwaitdown.8 man/svwaitup.8
diff --git a/debian/changelog b/debian/changelog
@@ -1,3 +1,9 @@
+runit (0.4.1-1) woody; urgency=low
+
+ * See /package/admin/runit/package/CHANGES.
+
+ -- Gerrit Pape <pape@smarden.org> Mon, 24 Jun 2002 16:07:53 +0200
+
runit (0.4.0-1) woody; urgency=low
* See /package/admin/runit/package/CHANGES.
diff --git a/debian/postinst b/debian/postinst
@@ -25,7 +25,7 @@ set -e
case "$1" in
configure)
( \
- cd /package/admin/runit-0.4.0
+ cd /package/admin/runit-0.4.1
package/upgrade
)
;;
diff --git a/debian/rules b/debian/rules
@@ -23,18 +23,18 @@ build-stamp:
# $(MAKE)
#/usr/bin/docbook-to-man debian/runit.sgml > runit.1
- tar xfzvp runit-0.4.0.tar.gz
+ tar xfzvp runit-0.4.1.tar.gz
( \
- cd admin/runit-0.4.0 ; \
+ cd admin/runit-0.4.1 ; \
echo 'diet gcc -O2 -Wall' > src/conf-cc ; \
echo 'diet gcc -s -Os -pipe' > src/conf-ld ; \
package/compile ; \
echo 'gcc -O2 -Wall' > src/conf-cc ; \
echo 'gcc -s' > src/conf-ld ; \
( cd compile ; make utmpset ) ; \
- echo "/package/admin/runit-0.4.0" > compile/home ; \
+ echo "/package/admin/runit-0.4.1" > compile/home ; \
rm -f compile/src ; \
- ln -s /package/admin/runit-0.4.0/src compile/src ; \
+ ln -s /package/admin/runit-0.4.1/src compile/src ; \
install -m0755 compile/utmpset command/utmpset ; \
)
touch build-stamp
@@ -62,40 +62,40 @@ install: build
chmod 1755 debian/runit/package
cp -a admin debian/runit/package/
- rm -rf debian/runit/package/admin/runit-0.4.0/compile
- cp -a debian/runit/package/admin/runit-0.4.0/man .
- rm -rf debian/runit/package/admin/runit-0.4.0/man
- cp -a debian/runit/package/admin/runit-0.4.0/doc .
- rm -rf debian/runit/package/admin/runit-0.4.0/doc
- cp -a debian/runit/package/admin/runit-0.4.0/etc .
- rm -rf debian/runit/package/admin/runit-0.4.0/etc
- cp -a debian/runit/package/admin/runit-0.4.0/package .
+ rm -rf debian/runit/package/admin/runit-0.4.1/compile
+ cp -a debian/runit/package/admin/runit-0.4.1/man .
+ rm -rf debian/runit/package/admin/runit-0.4.1/man
+ cp -a debian/runit/package/admin/runit-0.4.1/doc .
+ rm -rf debian/runit/package/admin/runit-0.4.1/doc
+ cp -a debian/runit/package/admin/runit-0.4.1/etc .
+ rm -rf debian/runit/package/admin/runit-0.4.1/etc
+ cp -a debian/runit/package/admin/runit-0.4.1/package .
# /etc/runit
- cp -p admin/runit-0.4.0/etc/debian/[123] \
+ cp -p admin/runit-0.4.1/etc/debian/[123] \
debian/runit/etc/runit/
- cp -p admin/runit-0.4.0/etc/debian/ctrlaltdel \
+ cp -p admin/runit-0.4.1/etc/debian/ctrlaltdel \
debian/runit/etc/runit/
- cp -p admin/runit-0.4.0/etc/debian/getty-tty5/run.utmpset \
+ cp -p admin/runit-0.4.1/etc/debian/getty-tty5/run.utmpset \
debian/runit/etc/runit/getty-5/run
# runit programs
- cp -p debian/runit/package/admin/runit-0.4.0/command/runit* \
+ cp -p debian/runit/package/admin/runit-0.4.1/command/runit* \
debian/runit/sbin/
# cleanup
- rm -rf debian/runit/package/admin/runit-0.4.0/compile
+ rm -rf debian/runit/package/admin/runit-0.4.1/compile
# create debian/links
rm -f debian/links
for i in \
- `cat debian/runit/package/admin/runit-0.4.0/package/commands` ; \
+ `cat debian/runit/package/admin/runit-0.4.1/package/commands` ; \
do \
echo "/package/admin/runit/command/$$i /command/$$i" \
>> debian/links ; \
done
# for i in \
-# `cat debian/runit/package/admin/runit-0.4.0/package/commands` ; \
+# `cat debian/runit/package/admin/runit-0.4.1/package/commands` ; \
# do \
# echo "/command/$$i /usr/local/bin/$$i" \
# >> debian/links ; \
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.4.0.tar.gz">runit-0.4.0.tar.gz</a> into <tt>/package</tt>
+<a href="runit-0.4.1.tar.gz">runit-0.4.1.tar.gz</a> into <tt>/package</tt>
and unpack the archive
<pre>
# cd /package
- # gunzip runit-0.4.0.tar
- # tar -xpf runit-0.4.0.tar
- # rm runit-0.4.0.tar
- # cd admin/runit-0.4.0
+ # gunzip runit-0.4.1.tar
+ # tar -xpf runit-0.4.1.tar
+ # rm runit-0.4.1.tar
+ # cd admin/runit-0.4.1
</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.4.0@smarden.org
+ # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.4.1@smarden.org
</pre>
<hr>
@@ -187,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.4.0@smarden.org
+ # ( uname -a ; cat /etc/runit/[123] ) | mail pape-runit-0.4.1@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/utmpset.html b/doc/utmpset.html
@@ -37,12 +37,13 @@ For each <tt>getty</tt> service, add a line to the corresponding <tt>run</tt>
script like this:
<pre>
#!/bin/sh
- /package/admin/runit/command/utmpset tty5
+ /package/admin/runit/command/utmpset -w tty5
exec /sbin/getty 38400 tty5 linux
</pre>
This will cause the <tt>utmp</tt> record for line <tt>tty5</tt> to be cleared
-before the <tt>getty</tt> is started; login accounting works as expected for
-this line.
+before the <tt>getty</tt> is started; <i>utmpset</i> additionally writes a
+<tt>wtmp</tt> record if the <tt>-w</tt> option is given. Login accounting
+then works as expected for this line.
<hr>
<address><a href="mailto:pape@smarden.org">
Gerrit Pape <pape@smarden.org>
diff --git a/etc/debian/getty-tty5/run.utmpset b/etc/debian/getty-tty5/run.utmpset
@@ -1,3 +1,3 @@
#!/bin/sh
-/package/admin/runit/command/utmpset tty5
+/package/admin/runit/command/utmpset -w tty5
exec /sbin/getty 38400 tty5 linux
diff --git a/package/CHANGES b/package/CHANGES
@@ -1,3 +1,7 @@
+runit 0.4.1
+Mon, 24 Jun 2002 15:53:11 +0200
+ * utmpset.c: new option -w: additionally write wtmp record.
+
runit 0.4.0
Sun, 19 May 2002 12:28:29 +0200
* src/: include public domain sources to build byte.a, unix.a, time.a:
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.4.0...'
+echo 'Creating symlink runit -> runit-0.4.1...'
rm -f runit
-ln -s runit-0.4.0 runit
+ln -s runit-0.4.1 runit
mv -f runit ..
echo 'Making command links in /command...'
diff --git a/src/utmpset.c b/src/utmpset.c
@@ -1,6 +1,6 @@
#include "strerr.h"
-
-#define USAGE " line"
+#include "sgetopt.h"
+#define USAGE " [-w] line"
#define WARNING "utmpset: warning: "
const char *progname;
@@ -10,9 +10,27 @@ void usage(void) {
}
int main (int argc, const char * const *argv, const char * const *envp) {
- progname =*argv++;
- if (! *argv || ! **argv) usage();
+ int opt;
+ int wtmp =0;
+
+ progname =*argv;
+
+ while ((opt =getopt(argc, argv, "wV")) != opteof) {
+ switch(opt) {
+ case 'w':
+ wtmp =1;
+ break;
+ case 'V':
+ strerr_warn1("$Id$", 0);
+ case '?':
+ usage();
+ }
+ }
+ argv +=optind;
+
+ if (! argv || ! *argv) usage();
if (logout(*argv) != 1)
- strerr_warn4(WARNING, "unable to logout line ", *argv, ": ", &strerr_sys);
+ strerr_die4sys(0, WARNING, "unable to logout line ", *argv, ": ");
+ if (wtmp) logwtmp(*argv, 0, 0);
exit(0);
}