From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1259 Path: news.gmane.org!not-for-mail From: Alex Efros Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: sv exit doesn't seem to work properly Date: Mon, 2 Oct 2006 05:05:00 +0300 Message-ID: <20061002020500.GD31951@home.power> References: <20061001201936.GA669@annvix.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=SHA1; protocol="application/pgp-signature"; boundary="b8GWCKCLzrXbuNet" X-Trace: sea.gmane.org 1159754721 3907 80.91.229.2 (2 Oct 2006 02:05:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Oct 2006 02:05:21 +0000 (UTC) Original-X-From: supervision-return-1495-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Oct 02 04:05:17 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 1GUDAy-00055M-RM for gcsg-supervision@gmane.org; Mon, 02 Oct 2006 04:05:01 +0200 Original-Received: (qmail 22640 invoked by uid 76); 2 Oct 2006 02:05:22 -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 22634 invoked from network); 2 Oct 2006 02:05:22 -0000 Original-To: supervision@list.skarnet.org Mail-Followup-To: supervision@list.skarnet.org Content-Disposition: inline In-Reply-To: <20061001201936.GA669@annvix.org> User-Agent: Mutt/1.5.11 Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1259 Archived-At: --b8GWCKCLzrXbuNet Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi! On Sun, Oct 01, 2006 at 02:19:36PM -0600, Vincent Danen wrote: > Am I doing something wrong? Yep. sv work correctly. But you must kill runsvdir first. If you 'exit' runsv without killing runsvdir, then runsvdir will restart runsv, then runsv will restart service which isn't what you want in /etc/runit/3. ;-) > My stage 3 script looks like this: My stage 3 script start with some fd redirection and log initialization, then: # 1) Send TERM to (all - some users on my servers also run it) runsvdir # to force it exit immediately. # 2) Send TERM to all runsv (same as `sv exit`). # 3) Send TERM to all services (so services will receive 2 TERM signals - # one from their runsv and one from this command, but this is harmless). # 4) Send TERM to all other processes, not monitored by runsv. killall5 -15 # 1) Gracefully wait up to 7 seconds until all services will be down before # continue shutdown process. # 2) I'm not sure, but may also send KILL to hang services - not sure # because runsv already asked to 'exit' by previous command. sv force-stop /var/service/* &>/dev/null and after these commands shutdown continues: saving sound mixer state, down network interfaces, adding reboot record to wtmp, killall5 -9 (just for the case), and unmount everything. -- WBR, Alex. --b8GWCKCLzrXbuNet Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) iD8DBQBFIHPMVItT6Fy+r6QRAu5BAJ9E4K/WeEeP0S4z0pUhylKBD+tJ/wCfWTYf GhLUJ47qSNLecsV6D6LybRk= =afLz -----END PGP SIGNATURE----- --b8GWCKCLzrXbuNet--