Re: runit proper shutdown

From: Charlie Brady <charlieb-supervision_at_budge.apana.org.au>
Date: Wed, 23 Oct 2013 12:58:19 -0400 (EDT)

On Wed, 23 Oct 2013, Joe M wrote:

> Hello,
>
> Following the advice the below articles:
>
> http://mywiki.wooledge.org/ProcessManagement#I.27m_trying_to_kill_-9_my_job_but_blah_blah_blah...

Except you aren't apparently following this piece of advice:

  If the process is ignoring normal SIGTERMs, then get the source code
  and fix it!

> http://partmaps.org/era/unix/award.html#uuk9letter
>
> I am trying to figure out how to implement "Generally, send 15 (TERM),
> and wait a second or two, and if that doesn't work, send 2 (INT), and
> if that doesn't work, send 1 (HUP)."
>
> I tried to do this in "3":
>
> sync && sync && sync
>
> echo 'Waiting for services to stop...'
> # send 15 (TERM), wait a second or two
> sv -w5 term /run/runit/runsvdir/current/*
>
> # if that doesn't work, send 2 (INT)
> sv -w5 interrupt /run/runit/runsvdir/current/*
>
> # if that doesn't work, send 1 (HUP)
> sv -w5 hup /run/runit/runsvdir/current/*
> sleep 5
>
> # below shutdown sends TERM and CONT to running services
> sv -w30 shutdown /run/runit/runsvdir/current/*
>
> But, when I send the INT, sv seems to be starting the process instead.

Presumably the supervised process has exited, as you wanted it to do, and
runsv is starting a new instance, as it is expected to.

If you want runsv not to start a new instance, you have to use 'down' or
'stop' as args to 'sv'.

What program are you trying to supervise which you find is so unreliably
responsive to signals?

> Is there a better way to go about this, please?
>
> Thanks
> Joe
>
Received on Wed Oct 23 2013 - 16:58:19 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:44:18 UTC