From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1018 Path: news.gmane.org!not-for-mail From: Alex Efros Newsgroups: gmane.comp.sysutils.supervision.general Subject: right way to shutdown services Date: Mon, 13 Feb 2006 19:06:52 +0200 Organization: asdfGroup Inc., http://powerman.asdfGroup.com/ Message-ID: <20060213170652.GF1471@home.power> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1139850453 6438 80.91.229.2 (13 Feb 2006 17:07:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Feb 2006 17:07:33 +0000 (UTC) Original-X-From: supervision-return-1254-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Feb 13 18:07:31 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 1F8hA5-0004LV-Mk for gcsg-supervision@gmane.org; Mon, 13 Feb 2006 18:06:54 +0100 Original-Received: (qmail 4267 invoked by uid 76); 13 Feb 2006 17:07:14 -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 4261 invoked from network); 13 Feb 2006 17:07:14 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline User-Agent: Mutt/1.5.11 Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1018 Archived-At: 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.