Intercepting invoke-rc.d through policy-rc.d or runit-run from ubuntu ?

118 views
Skip to first unread message

olivier...@telecom-sudparis.eu

unread,
May 1, 2014, 10:02:13 AM5/1/14
to passenge...@googlegroups.com
Hi.

I'm installing applications (Debian packages) which configure other services and require restarts during postinsts, or through the course of a functionnal test suite.

These will typically use invoke-rc.d on a traditionnal Debian system.

However, once inside a debian docker container, the policy-rc.d installed by mkimage-debootstrap.sh will disable such invocations.

I'm thinking that maybe baseimage-docker could provide an improved policy-rc.d since it relies on runit, maybe using Ubuntu's runit-run package.

Has anyone attempted this ? Would it make sense ?

Thanks in advance.

Best regards,

Hongli Lai

unread,
May 13, 2014, 8:15:06 AM5/13/14
to passenge...@googlegroups.com
I don't think it would make sense. Runit works very differently than
Upstart. Creating a custom policy-rc.d that integrates with Runit
would probably cause more problems than it solves.
> --
> You received this message because you are subscribed to the Google Groups
> "passenger-docker" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to passenger-dock...@googlegroups.com.
> To post to this group, send email to passenge...@googlegroups.com.
> Visit this group at http://groups.google.com/group/passenger-docker.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/passenger-docker/aa0eaeac-89d7-449d-b0be-16d60b599309%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Phusion | Web Application deployment, scaling, and monitoring solutions

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Olivier Berger

unread,
May 14, 2014, 2:47:18 AM5/14/14
to passenge...@googlegroups.com
Hi.

Hongli Lai <hon...@phusion.nl> writes:

> I don't think it would make sense. Runit works very differently than
> Upstart. Creating a custom policy-rc.d that integrates with Runit
> would probably cause more problems than it solves.
>

I agree it's not necessarily usfeul in all cases, but I do have a need
for this in the case when I'm testing Debian packages whose postinst
scripts tend to ask restart of services like apache or postgresql, using
invoke-rc.d.
Now, with upstart it may be different, but on Debian, it's not yet (and
probably won't be) upstart, so there's clearly a use case.

The interesting feature of sv is that you can symlink /etc/init.d/
scripts to it and it works (upstream feature apparently).

You'll find at
https://fusionforge.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=fusionforge/users/olberger.git;a=blob;f=vm/docker/policy-rc.d;h=acf10b5bb2159044f3c94fc90d6943d98b226d2d;hb=refs/heads/docker
an example of such a policy-rc.d script, which allows me to intercept
calls to invoke-rc.d in package postinst script and divert them
("silently") to sv invocations.

Hope this helps.

Best regards,
--
Olivier BERGER
http://www-public.telecom-sudparis.eu/~berger_o/ - OpenPGP-Id: 2048R/5819D7E8
Ingenieur Recherche - Dept INF
Institut Mines-Telecom, Telecom SudParis, Evry (France)

Hongli Lai

unread,
May 14, 2014, 4:26:42 AM5/14/14
to passenge...@googlegroups.com
Can't you restart those services manually? Why do you need the
packages to automatically restart them for you? I know it's a bit less
convenient than doing it manually but a lot less things can go wrong.

The symlink feature is cool, I didn't know about it. However it would
be hard to make it work in the general case. Not all sysvinit services
should be running when in a Docker container.
> --
> You received this message because you are subscribed to the Google Groups "passenger-docker" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to passenger-dock...@googlegroups.com.
> To post to this group, send email to passenge...@googlegroups.com.
> Visit this group at http://groups.google.com/group/passenger-docker.
> To view this discussion on the web visit https://groups.google.com/d/msgid/passenger-docker/87fvkc26x5.fsf%40inf-8660.int-evry.fr.

Olivier Berger

unread,
May 14, 2014, 12:15:28 PM5/14/14
to Hongli Lai, passenge...@googlegroups.com
Hongli Lai <hon...@phusion.nl> writes:

> Can't you restart those services manually? Why do you need the
> packages to automatically restart them for you? I know it's a bit less
> convenient than doing it manually but a lot less things can go wrong.
>

My use case is testing installation of applications inside docker, like
FusionForge, which reconfigures postgresql and apache2, then passing its
test suite that stops postgres, restores DB backup, restarts it, etc.

> The symlink feature is cool, I didn't know about it. However it would
> be hard to make it work in the general case. Not all sysvinit services
> should be running when in a Docker container.
>

Sure.

In any case, if anyone is interested, hopefuly, they'll notice the
discussion and will make good use of this.
Reply all
Reply to author
Forward
0 new messages