runit

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit e809d3102e33eaf685c634a562eae309fa702d16
parent 0c58079d7acf03565d8f596f4c5c572a19f86cb6
Author: Gerrit Pape <pape@smarden.org>
Date:   Sun,  6 Oct 2002 10:28:16 +0000

minor.

Diffstat:
Mdebian/changelog | 2+-
Mpackage/CHANGES | 3++-
Msrc/svwaitdown.c | 46++++++++++++++++++++++------------------------
3 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/debian/changelog b/debian/changelog @@ -4,7 +4,7 @@ runit (0.6.4-1) sarge; urgency=low * preinst: new; create hardlink /sbin/runit.old -> /sbin/runit on upgrade. - -- Gerrit Pape <pape@smarden.org> Sun, 6 Oct 2002 11:41:41 +0200 + -- Gerrit Pape <pape@smarden.org> Sun, 6 Oct 2002 12:24:15 +0200 runit (0.6.0-1) sarge; urgency=low diff --git a/package/CHANGES b/package/CHANGES @@ -1,5 +1,5 @@ runit 0.6.4 -Sun, 06 Oct 2002 11:41:29 +0200 +Sun, 06 Oct 2002 12:23:56 +0200 * runsvdir.c: check service directory's inode and device in addition to mtime; sleep at least 1 second before restarting run svprocesses. * runsv.c: use status[19] for state information; control pipe supports e. @@ -8,6 +8,7 @@ Sun, 06 Oct 2002 11:41:29 +0200 * runsvchdir: new; change directory runsvdir is running in (switch runlevels). * man/runsvchdir.8, doc/runsvchdir.8.html: new. + * svwaitdown.c: -k option: only kill service that still are up on timeout. runit 0.6.0 Fri, 27 Sep 2002 16:34:57 +0200 diff --git a/src/svwaitdown.c b/src/svwaitdown.c @@ -12,6 +12,8 @@ #define INFO "svwaitdown: " #define USAGE " [ -v ] [ -t 2..6000 ] service ..." +#define VERSION "$Id$" + const char *progname; const char * const *dir; unsigned int rc =0; @@ -59,7 +61,7 @@ int main (int argc, const char * const *argv) { verbose =1; break; case 'V': - strerr_warn1("$Id$", 0); + strerr_warn1(VERSION, 0); case '?': usage(); } @@ -125,35 +127,31 @@ int main (int argc, const char * const *argv) { /* timeout */ if (verbose) strerr_warn2(INFO, "timeout.", 0); if (dokill) { - dir =argv; - while (*dir) { - if (chdir(*dir) == -1) { - warn(*dir, ": unable to change directory: ", &strerr_sys); - continue; - } - if ((fd =open_write("supervise/control")) == -1) { - if (errno == error_nodevice) { - if (verbose) - strerr_warn3(INFO, *dir, - ": supervise not running.", 0); - dir++; - } - else - warn(*argv, ": unable to open supervise/control: ", &strerr_sys); - continue; + if (chdir(*dir) == -1) { + warn(*dir, ": unable to change directory: ", &strerr_sys); + continue; + } + if ((fd =open_write("supervise/control")) == -1) { + if (errno == error_nodevice) { + if (verbose) + strerr_warn3(INFO, *dir, ": supervise not running.", 0); + dir++; } - if (write(fd, "k", 1) != 1) - warn(*argv, - ": unable to write to supervise/control: ", &strerr_sys); else - strerr_warn3(INFO, *dir, ": killed.", 0); - close(fd); - dir++; + warn(*argv, ": unable to open supervise/control: ", &strerr_sys); + continue; } + if (write(fd, "k", 1) != 1) + warn(*argv, ": unable to write to supervise/control: ", &strerr_sys); + else + strerr_warn3(INFO, *dir, ": killed.", 0); + close(fd); + dir++; + if (! *dir) exit(111); + continue; } exit(111); } - sleep(1); } if (rc > 100) rc =100;