From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1379 Path: news.gmane.org!not-for-mail From: Alex Efros Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: How to kill runsv, no matter what? Date: Fri, 23 Feb 2007 16:24:15 +0200 Organization: asdfGroup Inc., http://powerman.asdfGroup.com/ Message-ID: <20070223142415.GR11107@home.power> References: <5422d5e60702211214q7ecaf23co838e9ff1b9be32de@mail.gmail.com> <5422d5e60702211304g5051747aoad3dd893abaf0b16@mail.gmail.com> <5422d5e60702221951h1abb7e60l77717192900a63a8@mail.gmail.com> <20070223140504.17459.qmail@3f646761ee1f68.315fe32.mid.smarden.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1172240674 8469 80.91.229.12 (23 Feb 2007 14:24:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Feb 2007 14:24:34 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1615-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Feb 23 15:24:18 2007 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by lo.gmane.org with smtp (Exim 4.50) id 1HKbLN-0006CL-RS for gcsg-supervision@gmane.org; Fri, 23 Feb 2007 15:24:17 +0100 Original-Received: (qmail 4118 invoked by uid 76); 23 Feb 2007 14:24:39 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 4112 invoked from network); 23 Feb 2007 14:24:39 -0000 Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <20070223140504.17459.qmail@3f646761ee1f68.315fe32.mid.smarden.org> User-Agent: Mutt/1.5.13 (2006-08-11) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1379 Archived-At: Hi! On Fri, Feb 23, 2007 at 02:05:03PM +0000, Gerrit Pape wrote: > to exit, it sends the service (the ./test1-sv.sh shell script) a TERM > signal, the shell script terminates (fine), but is leaving behind the There one another similar issue: if service run interactive bash (getty-like services) then it also will not stop. # sv t getty1 send SIGTERM while bash require SIGHUP or SIGKILL instead of SIGTERM. Moreover, if you run mc - it will run it's own bash which also should be killed to restart getty service... and same is true for things like su. To solve this I create script /usr/local/bin/term-getty-service: ---cut--- #!/bin/bash bashs() { while [[ -n "$1" ]]; do pgrep -P $1 bash; bashs $(pgrep -P $1); shift; done; } bashs="$( bashs $(