* inhibiting /etc/init.d/foo on debian?
@ 2007-12-28 18:09 Adam Megacz
2007-12-28 20:28 ` KORN Andras
0 siblings, 1 reply; 2+ messages in thread
From: Adam Megacz @ 2007-12-28 18:09 UTC (permalink / raw)
To: supervision
Hello,
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?
In particular, this causes rather severe problems for some daemons
that do not cope well with having two copies of themselves running at
the same time.
Thanks!
- a
--
PGP/GPG: 5C9F F366 C9CF 2145 E770 B1B8 EFB1 462D A146 C380
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: inhibiting /etc/init.d/foo on debian?
2007-12-28 18:09 inhibiting /etc/init.d/foo on debian? Adam Megacz
@ 2007-12-28 20:28 ` KORN Andras
0 siblings, 0 replies; 2+ messages in thread
From: KORN Andras @ 2007-12-28 20:28 UTC (permalink / raw)
To: supervision
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-28 20:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-28 18:09 inhibiting /etc/init.d/foo on debian? Adam Megacz
2007-12-28 20:28 ` KORN Andras
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).