runit

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

commit e43ded41cfa231c8e9e5428a529ed334b940376d
parent ed4ee10ebdaafda925808849482c60b713613992
Author: Gerrit Pape <pape@smarden.org>
Date:   Tue, 11 Nov 2003 10:55:44 +0000

  * runsv.c: don't start new processes while collecting children.

Diffstat:
Mpackage/CHANGES | 1+
Msrc/runsv.c | 25++++---------------------
2 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/package/CHANGES b/package/CHANGES @@ -1,6 +1,7 @@ * doc/runscripts: add pppd run script (with chpst) next to the ppp one. * man/chpst.8: typo. * etc/debian/3: test -r -> test -x (thx Alejandro Mery). + * runsv.c: don't start new processes while collecting children. runit 0.12.0 Wed, 29 Oct 2003 18:27:48 +0000 diff --git a/src/runsv.c b/src/runsv.c @@ -432,8 +432,10 @@ int main(int argc, char **argv) { char ch; if (haslog) - if (! svd[1].pid && svd[1].want == W_UP) startservice(&svd[1]); - if (! svd[0].pid && svd[0].want == W_UP) startservice(&svd[0]); + if (! svd[1].pid && (svd[1].want == W_UP)) startservice(&svd[1]); + if (! svd[0].pid) + if ((svd[0].want == W_UP) || (svd[0].state == S_FINISH)) + startservice(&svd[0]); x[0].fd =selfpipe[0]; x[0].events =IOPAUSE_READ; @@ -465,30 +467,17 @@ int main(int argc, char **argv) { if (child == svd[0].pid) { svd[0].pid =0; pidchanged =1; - svd[0].state =S_DOWN; svd[0].ctrl &=~C_TERM; taia_now(&svd[0].start); if (svd[0].state != S_FINISH) if ((fd =open_read("finish")) != -1) { close(fd); svd[0].state =S_FINISH; - // startservice(&svd[0]); - // svd[0].want =W_UP; update_status(&svd[0]); break; } - /* svd[0].state =S_DOWN; - svd[0].ctrl &=~C_TERM; - taia_now(&svd[0].start); - */ update_status(&svd[0]); - /* - if (svd[0].want == W_UP) { - startservice(&svd[0]); - break; - } - */ } if (haslog) { if (child == svd[1].pid) { @@ -498,12 +487,6 @@ int main(int argc, char **argv) { svd[1].ctrl &=~C_TERM; taia_now(&svd[1].start); update_status(&svd[1]); - /* - if (svd[1].want == W_UP) { - startservice(&svd[1]); - break; - } - */ } } }