[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: On init in Debian

On 03/17/2012 08:40 PM, Philip Hands wrote:
> I'm happy to help with that ...

Cool! Let's do it together then.

> although, I doubt we're the first people
> to think of something like this, and it would be a shame to ignore an
> existing solution.
> RedHat have some functions for use in init scripts, in
> /etc/rc.d/functions (although I've not used RedHat for a decade or more,
> so I've no idea what's included there).

I had a look in a CentOS VM, and I didn't see such file. Is it only in RHEL?

> OpenWRT does something quite interesting, which is that they have an
> /etc/rc.common and then make the init scripts start thus:
> #!/bin/sh /etc/rc.common
> # Copyright (C) 2006-2010 OpenWrt.org
> # Copyright (C) 2006 Carlos Sobrinho
> NAME=dropbear
> PROG=/usr/sbin/dropbear
> START=50
> STOP=50
> ...
> so the thing that actually gets run is the /etc/rc.common, which sources
> the init.d script at its end, so it is possible to override any part of
> the common script by including functions in the service specific script,
> but otherwise it just does the default.

The idea is nice, I think that being able to overwrite the functions
you want is cool, even though there are many other ways to do it.
But it seems to be a bit hard to integrate with dh_installinit, Probably,
what we would like is a symlink to this rc.common, with the
package specific script being located in /etc/$whatver being sourced
by rc.common, right? Do you see how we could do and keep a
dh_installinit compatibility?


Reply to: