supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Alex Efros <powerman@powerman.asdfGroup.com>
Subject: Re: sv exit doesn't seem to work properly
Date: Mon, 2 Oct 2006 05:05:00 +0300	[thread overview]
Message-ID: <20061002020500.GD31951@home.power> (raw)
In-Reply-To: <20061001201936.GA669@annvix.org>

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

Hi!

On Sun, Oct 01, 2006 at 02:19:36PM -0600, Vincent Danen wrote:
> Am I doing something wrong?

Yep. sv work correctly. But you must kill runsvdir first. If you 'exit'
runsv without killing runsvdir, then runsvdir will restart runsv, then
runsv will restart service which isn't what you want in /etc/runit/3. ;-)

> My stage 3 script looks like this:

My stage 3 script start with some fd redirection and log initialization,
then:

# 1) Send TERM to (all - some users on my servers also run it) runsvdir
#    to force it exit immediately.
# 2) Send TERM to all runsv (same as `sv exit`).
# 3) Send TERM to all services (so services will receive 2 TERM signals -
#    one from their runsv and one from this command, but this is harmless).
# 4) Send TERM to all other processes, not monitored by runsv.
killall5 -15
# 1) Gracefully wait up to 7 seconds until all services will be down before
#    continue shutdown process.
# 2) I'm not sure, but may also send KILL to hang services - not sure
#    because runsv already asked to 'exit' by previous command.
sv force-stop /var/service/* &>/dev/null

and after these commands shutdown continues: saving sound mixer state,
down network interfaces, adding reboot record to wtmp, killall5 -9 (just
for the case), and unmount everything.

-- 
			WBR, Alex.

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

      reply	other threads:[~2006-10-02  2:05 UTC|newest]

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

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=20061002020500.GD31951@home.power \
    --to=powerman@powerman.asdfgroup.com \
    /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).