supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Vincent Danen <vdanen@linsec.ca>
Subject: sv exit doesn't seem to work properly
Date: Sun, 1 Oct 2006 14:19:36 -0600	[thread overview]
Message-ID: <20061001201936.GA669@annvix.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]

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 getties 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 services 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.

-- 
{FEE30AD4 : 7F6C A60C 06C2 4811 FA1C  A2BC 2EBC 5E32 FEE3 0AD4}
mysql> SELECT * FROM users WHERE clue > 0;
Empty set (0.00sec)

[-- Attachment #2: Type: application/pgp-signature, Size: 186 bytes --]

             reply	other threads:[~2006-10-01 20:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-01 20:19 Vincent Danen [this message]
2006-10-02  2:05 ` Alex Efros

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061001201936.GA669@annvix.org \
    --to=vdanen@linsec.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).