From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/996 Path: news.gmane.org!not-for-mail From: Henrik Heil Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: runit and System shutdown Date: Mon, 30 Jan 2006 21:46:52 +0100 Message-ID: <43DE7B3C.7080501@zweipol.net> References: <20060127101745.GB4010@b491.dyndns.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1138654059 20727 80.91.229.2 (30 Jan 2006 20:47:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 30 Jan 2006 20:47:39 +0000 (UTC) Original-X-From: supervision-return-1232-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Jan 30 21:47:27 2006 Return-path: Envelope-to: gcsg-supervision@gmane.org Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1F3fvN-0003uS-L5 for gcsg-supervision@gmane.org; Mon, 30 Jan 2006 21:46:58 +0100 Original-Received: (qmail 18887 invoked by uid 76); 30 Jan 2006 20:47:18 -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 18881 invoked from network); 30 Jan 2006 20:47:17 -0000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.6 Mnenhy/0.6.0.101 X-Accept-Language: en-us, en Original-To: supervision@list.skarnet.org In-Reply-To: <20060127101745.GB4010@b491.dyndns.org> Xref: news.gmane.org gmane.comp.sysutils.supervision.general:996 Archived-At: Hi, > i am using runit 1.0.5 on my Debian/Sarge for all the Daemons except > postfix. runsvdir-start is run from inittab. I have a similar setup on 2 servers and was wondering about the right way to do this. > To me this sounds like total loss of control. Its quite a > mess. Is there something i dont understand? Shouldnt there be an > init-script that does runsvctrl d /var/services/* as the first Action > in Runlevel 0? In addition to the the shutdown of runsv, services and logservices in no particular order I recently noticed that with the default inittab-entry in runlevel 6: * sendsigs TERM makes runsvdir exit immediatly, tells all processes to terminate an waits 5 seconds * meanwhile SysV-init restarts runsvdir and runsvdir starts all services * after 5 seconds all services are killed(-9) by sendsigs I am using this inittab-entry for now: RT1a:12345:respawn:/usr/sbin/runsvdir-start RT1b:06:once:/usr/sbin/runsvdir-start I am not shure about the shutdown-initscript. I was thinking in that direction but would like to use "svwaitdown -x -t 10 /var/services/*" because * it waits for the services to actually stop. * I believe it guarantees to stop the logservice after the service (is this correct?). So an (untested) shutdown-script would be: kill `pidof runsvdir` svwaitdown -x -t 10 /var/services/* (only works if runsvdir does not respawn -- see above) Apart from the SysV-integration problem with the respawning runsvdir I think runit does the right thing when the commands receive a TERM signal: If runsv receives a TERM it acts like runsvctl x. If runsvdir receives a TERM signal, it exits with 0 immediately. Even if you don't stop any services I believe it's unlikely that runsv tries to restart a service before it receives sendsigs TERM and itsself waits for the service to exit. So if you don't have somthing that takes more than 5 seconds to stop nothing too bad should happen. But I am still not too familiar with process supervision an would really like to hear comments or a recommended way to stop runit under SysV-init from the experts. Regards, Henrik -- Henrik Heil, zweipol Coy & Heil GbR http://www.zweipol.net/