From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1258 Path: news.gmane.org!not-for-mail From: Vincent Danen Newsgroups: gmane.comp.sysutils.supervision.general Subject: sv exit doesn't seem to work properly Date: Sun, 1 Oct 2006 14:19:36 -0600 Organization: Annvix Message-ID: <20061001201936.GA669@annvix.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Qxx1br4bt0+wmkIi" X-Trace: sea.gmane.org 1159734018 21247 80.91.229.2 (1 Oct 2006 20:20:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Oct 2006 20:20:18 +0000 (UTC) Original-X-From: supervision-return-1494-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Oct 01 22:20:16 2006 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1GU7nI-0003D7-Ur for gcsg-supervision@gmane.org; Sun, 01 Oct 2006 22:20:13 +0200 Original-Received: (qmail 13936 invoked by uid 76); 1 Oct 2006 20:20:33 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 13930 invoked from network); 1 Oct 2006 20:20:33 -0000 Original-To: supervision@list.skarnet.org Content-Disposition: inline X-Mailer: Mutt 1.5.x/OS X 10.4.x X-PGP-Key: http://linsec.ca/vdanen.asc X-URL: http://annvix.org/ User-Agent: Mutt/1.5.10i X-SA-Exim-Connect-IP: 68.149.37.7 X-SA-Exim-Mail-From: vdanen@annvix.org X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on hades.annvix.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=6.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.0 X-SA-Exim-Version: 4.2 (built Wed, 01 Feb 2006 18:29:36 -0700) X-SA-Exim-Scanned: Yes (on hades.annvix.org) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1258 Archived-At: --Qxx1br4bt0+wmkIi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Using runit 1.6.0, it doesn't look like "sv exit" is working as it should. I'm working to replace some scripts which use svwaitdown in /etc/runit/3 with using sv, and was trying to use "sv exit [service]" but when I do, the service goes down, runsv is killed, but then within a few seconds it's starting again. It's almost like it's not properly writing the new state for runsvdir to know we want it down. If I use "sv down [service]" the service goes down properly. It's not that big of a deal to use sv down in stage 3 I guess, but it's not what's illustrated in the sample debian script (which uses force-stop then exit). I figure using exit alone would be sufficient (force-stop shuts the service down but then it comes right back up when I use exit). Am I doing something wrong? My stage 3 script looks like this: [vdanen@build trunk]$ cat 3 #!/bin/execlineb /bin/fdmove -c 2 1 /bin/export PATH "/sbin:/bin:/usr/sbin:/usr/bin" /sbin/chpst -e /etc/sysconfig/env/runit/ /bin/import -D 180 STAGE_3_TIMEOUT /bin/import -D 14 GETTY_TIMEOUT /bin/elglob -0 GETTYS /service/mingetty-* /bin/elglob -0 ALLSERVICES /service/* /bin/foreground { /bin/echo "Waiting up to ${GETTY_TIMEOUT} seconds for get= ties to stop..." } /bin/foreground { /sbin/sv -w $GETTY_TIMEOUT force-stop $GETTYS } /bin/foreground { /sbin/sv exit $GETTYS } /bin/foreground { /bin/echo "Waiting up to ${STAGE_3_TIMEOUT} seconds for s= ervices to stop..." } /bin/foreground { /sbin/sv -w $STAGE_3_TIMEOUT force-stop $ALLSERVICES } /bin/foreground { /sbin/sv exit $ALLSERVICES } /bin/foreground { /bin/echo "Executing shutdown..." } /sbin/rc 0 It's pretty much the same as the debian script with a few additions and it's written in execline rather than bash. Any ideas? Right now I'm thinking just to use force-stop and get rid of the exit call altogether and let /sbin/rc handle sending all the runsv services the TERM signal when shutting the system down. --=20 {FEE30AD4 : 7F6C A60C 06C2 4811 FA1C A2BC 2EBC 5E32 FEE3 0AD4} mysql> SELECT * FROM users WHERE clue > 0; Empty set (0.00sec) --Qxx1br4bt0+wmkIi Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Darwin) iD8DBQFFICLYLrxeMv7jCtQRArsmAJ9dLgVaAv8DICLqhTPHr/rurSfrSgCfR7wZ iJZsGKcPHdgLvv7wVY6SBv4= =5Itb -----END PGP SIGNATURE----- --Qxx1br4bt0+wmkIi--