supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: KORN Andras <korn@elan.rulez.org>
To: supervision@list.skarnet.org
Subject: Re: inhibiting /etc/init.d/foo on debian?
Date: Fri, 28 Dec 2007 21:28:39 +0100	[thread overview]
Message-ID: <20071228202839.GT5663@utopia.intra.guy> (raw)
In-Reply-To: <x3tzm21ykc.fsf@nowhere.com>

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 <korn at chardonnay.math.bme.hu>
                 <http://chardonnay.math.bme.hu/~korn/>	QOTD:
                    I think, therefore I am overqualified.


      reply	other threads:[~2007-12-28 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-28 18:09 Adam Megacz
2007-12-28 20:28 ` KORN Andras [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071228202839.GT5663@utopia.intra.guy \
    --to=korn@elan.rulez.org \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).