runit proper shutdown

From: Joe M <joe9mail_at_gmail.com>
Date: Wed, 23 Oct 2013 11:49:34 -0500

Hello,

Following the advice the below articles:

http://mywiki.wooledge.org/ProcessManagement#I.27m_trying_to_kill_-9_my_job_but_blah_blah_blah...

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.
Is there a better way to go about this, please?

Thanks
Joe
Received on Wed Oct 23 2013 - 16:49:34 UTC

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