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: right way to shutdown services
Date: Mon, 13 Feb 2006 19:06:52 +0200	[thread overview]
Message-ID: <20060213170652.GF1471@home.power> (raw)

Hi!

I notice Pape recommend this to shutdown services:

    sv -w196 force-stop /var/service/*	    # TERM, pause, KILL
    sv exit /var/service/*		    # TERM, TERM to log, exit runsv

but it's unclear for me is it better than this:

    killall -HUP runsvdir
    killall -TERM runsv			    # TERM, TERM to log, exit runsv
    svwaitdown -t7 /var/service/*	    # pause
    # ... and some time later:
    killall5 -9				    # KILL

Pape's way may be better from this view: if ./run don't exit after TERM,
then it will be KILL'ed and __then__ TERM will be sent to ./log/run.
In my way ./log/run will be KILL'ed together with ./run and will've no
chance to exit gracefully on TERM. But... is it important, especially in
case we anyway forced to KILL ./run?

My way has another feature: it will try to gracefully shutdown
runsvdir/runsv processes which other, non-root users may run. There no
way to know which directory these users supervise with runsvdir, so I
unable to run 'sv exit /path/to/their/dir', but I still can HUP _all_
runsvdir and TERM (exit) _all_ runsv - this give their services chance
to exit gracefully on system shutdown.

To have both features probably enough to add '-k' option to my svwaitdown..?

-- 
			WBR, Alex.


                 reply	other threads:[~2006-02-13 17:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20060213170652.GF1471@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).