Re: Sourcing init-functions
Steve Langasek <firstname.lastname@example.org> writes:
> Hi Michael,
> On Sat, Jan 16, 2010 at 10:57:48AM +0100, Michael Welle wrote:
>> several init scripts use such a fragment for sourcing init-functions:
>> if ! [ -x "/lib/lsb/init-functions" ]; then
>> . /lib/lsb/init-functions
>> echo "E: /lib/lsb/init-functions not found, lsb-base (>= 3.0-6) needed"
>> exit 1
> What do you mean, "several"? What init scripts use this fragment? No init
> scripts on any of my systems do this.
several means that on the subset of all possible init scripts, that is
installed on my machines, an astonishing quantity use this construct ;):
root@Stella:/etc/init.d# grep '\-x.*init-functions' *
ippl:if ! [ -x "/lib/lsb/init-functions" ]; then
nagios3:if ! [ -x "/lib/lsb/init-functions" ]; then
ser2net:if ! [ -x "/lib/lsb/init-functions" ]; then
I guess there is a single source of this construct and then it is copied
and copied again.
>> What is the reason to bail out if the execute bit is set? Or should I
>> bug report these packages?
> Looks like nonsense to me. I think you should file a bug. For one thing,
> any init script that needs lsb-base (>= 3.0-6) *should depend on lsb-base
> (>= 3.0-6)*, not throw an error if it's not installed.
That is my feeling, too. I had discovered this annoyance while re-using
Debian init scripts on a Xen Server. While Debian init scripts are
supposed to work on the Debian distribution (which they do at the
moment) it is IMHO a good thing to make them as universal as possible
and I can't see what we gain with this restriction. In this sense init
scripts can have some logic built in to bail out if their runtime
environment doesn't fit. There are Unix system that do not use such a
sophisticated packaging system as Debian do and this way the scripts can
easiely be re-used.
biff4emacsen - A biff-like tool for (X)Emacs
Flood - Your friendly network packet generator