From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1374 Path: news.gmane.org!not-for-mail From: "Daniel Clark" Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: How to kill runsv, no matter what? Date: Wed, 21 Feb 2007 16:04:21 -0500 Message-ID: <5422d5e60702211304g5051747aoad3dd893abaf0b16@mail.gmail.com> References: <5422d5e60702211214q7ecaf23co838e9ff1b9be32de@mail.gmail.com> NNTP-Posting-Host: lo.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 1172091872 16057 80.91.229.12 (21 Feb 2007 21:04:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Feb 2007 21:04:32 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1610-gcsg-supervision=m.gmane.org@list.skarnet.org Wed Feb 21 22:04:25 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 1HJydT-0004xk-JL for gcsg-supervision@gmane.org; Wed, 21 Feb 2007 22:04:23 +0100 Original-Received: (qmail 2877 invoked by uid 76); 21 Feb 2007 21:04:45 -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 2872 invoked from network); 21 Feb 2007 21:04:45 -0000 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=peg1TlK3KYGxXtZbMBzFrfxQNlwRq93wtVALgsZ67S7aiQOopJ4aB3OSQXYArxgI/Uatd3k7quzDEuzvIS0qvgoywFo8ENDkoukPqf0tGaudWgjp1RMVhZVG+baSb+rolRF4IKocqPzkoKYeoeKLaU6NfkZpQm82UPWPJl+RjEw= Original-Sender: djbclark@gmail.com In-Reply-To: <5422d5e60702211214q7ecaf23co838e9ff1b9be32de@mail.gmail.com> Content-Disposition: inline X-Google-Sender-Auth: 86143063a75dd67b Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1374 Archived-At: On 2/21/07, Daniel Clark wrote: > I'm trying to get to a state where I can add and remove the runit > package without leaving any state behind (I'm using it for runsvdir, > not as an init replacement). When the package is removed, all of the > runit services should stop, and state about what services were started > is saved somewhere; on reinstall, that state should be reintroduced, > and any runit services should be restarted. > > In theory this should be pretty trivial (assuming I am RTFMing > correctly); I think something like this in the removal stage: > > test -d /usr/local/var/service/.disabled || mkdir > /usr/local/var/service/.disabled > mv /usr/local/var/service/* /usr/local/var/service/.disabled/ 2>/dev/null \ > || printf "No services to disable.\n" > printf "Waiting 7 seconds for runsv processes to die...\n" > sleep 7 > # ... (Code that stops runsvdir) ... > for service in `ls /usr/local/etc/sv`; do > test -d /usr/local/etc/sv/$service/supervise \ > && rm -rf /usr/local/etc/sv/$service/supervise > test -d /usr/local/etc/sv/$service/log/supervise \ > && rm -rf /usr/local/etc/sv/$service/log/supervise > done I happened upon an earlier mailing list thread, "sv exit doesn't seem to work properly" [1], and changed the code to stop runsvdir and then do a "sv exit" on each service [2], however it didn't help at all. For simplification the basic question is why "sv exit" doesn't stop runsv and runsv's associated processes with this particular service, bcfg2-client; if that can be fixed, then the rest of the problem is also solved. The run code for bcfg2-client was in my previous email, or you can see it here [3] and the script that it calls is here [4]. [1] Re: sv exit doesn't seem to work properly http://article.gmane.org/gmane.comp.sysutils.supervision.general/1259 [2] runit-1.7.2.ep: preremove script http://www.bcfg2.org/browser/branches/feature/runit/encap/src/encap-profiles/runit-1.7.2.ep#L182 [3] bcfg2-client run script http://www.bcfg2.org/browser/branches/feature/runit/encap/src/encap-profiles/bcfg2-0.9.2.ep#L409 [4] Script that the bcfg2-client run script kicks off http://www.bcfg2.org/browser/branches/feature/runit/encap/src/encap-profiles/bcfg2-0.9.2.ep#L373