From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/1583 Path: news.gmane.org!not-for-mail From: KORN Andras Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: inhibiting /etc/init.d/foo on debian? Date: Fri, 28 Dec 2007 21:28:39 +0100 Message-ID: <20071228202839.GT5663@utopia.intra.guy> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 X-Trace: ger.gmane.org 1198873534 12729 80.91.229.12 (28 Dec 2007 20:25:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Dec 2007 20:25:34 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-1818-gcsg-supervision=m.gmane.org@list.skarnet.org Fri Dec 28 21:25:47 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 1J8Lm4-0001Jt-81 for gcsg-supervision@gmane.org; Fri, 28 Dec 2007 21:25:44 +0100 Original-Received: (qmail 31439 invoked by uid 76); 28 Dec 2007 20:25:28 -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 30487 invoked from network); 28 Dec 2007 20:18:47 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-11) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:1583 Archived-At: On Fri, Dec 28, 2007 at 10:09:07AM -0800, Adam Megacz wrote: Hi, > On a bunch of machines I use runit for whatever services I care most > about, and leave /sbin/init running to handle the big piles of > miscellaneous stuff that debian keeps in /etc/init.d/ > > So far I've been inhibiting the runit-ified services from starting > using something like this: > > update-rc.d -f $1 remove > update-rc.d -f $1 stop 99 0 1 2 3 4 5 6 S . > > The only problem here is that many package install/uninstall scripts > explicitly invoke their own /etc/init.d scripts as part of the > prerm/postinst. Is there any way to stop the scripts from executing > in these situations, or (even better) make them perform the > appropriate "sv {up|down}" action? Sure. dpkg-divert --rename /etc/init.d/foo ln -s /usr/bin/sv /etc/init.d/foo And voila, you're done. The only drawback is that things like /etc/init.d/foo reload won't work because sv doesn't handle custom actions (unless you apply a patch I submitted to the Debian BTS). A different workaround would be to dpkg-divert the original foo initscript and write a new one that invokes sv start|stop|whatever when appropriate and does what the original script did on 'reload' and any other custom commands. Andras -- Andras Korn QOTD: I think, therefore I am overqualified.