Designing a new init: configuration

Sven Mueller debian at incase.de
Mon Aug 29 17:58:38 UTC 2005


Erich Schubert wrote on 28/08/2005 02:11:

> 1. First approach is probably the classic - init scripts.
> There is no real syntax specification, except everybody uses shell scripts.
> Dependencies could be handled either using LSB style comments
> http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/initscrcomconv.html
>
> Drawbacks I see:
> - needs special parser for LSB information
> - no/difficult status feedback into init system about availability
> - no direct monitoring/respawn of daemons
> Benefits:
> - LSB compliance
> - wide support in short timeframe
>
> Syntax:
> init scripts as usual and special comments in there.

An approach which is somewhat similar is to have special commands _to_
the init script, which output the dependency information. In other
words, call "/etc/init.d/service info" and it returns the information
otherwise encoded in the comments as LSB 3.0 says.

Drawbacks:
- needs special parser (depending on Syntax of the output, shell scripts
  might be able to simply 'eval' the output)
- no immediate status feedback into the init system about availability
  (one might be able to use the "status" command to the init script, but
  that could be a resource-eating way to do it).
- no direct/easy respawning
Benefits:
- could be easy to get relatively wide support for this in a short time
- Would be easy to add to LSB compliant scripts.
- Dependencies can change depending on service configuration.
  e.g. for spamassassin:
    DEPENDS="\$network"
    grep -q DBI:mysql: /etc/spamassassin/local.cf \
    && DEPENDS="mysql ${DEPENDS}"
    echo "Depends: ${DEPENDS}"

BTW: I would really love some way to determine the dependencies
dynamically at system startup time (or when a service is first started),
so that the local admin doesn't need to add "mysql" to spamassassins
dependencies when he enables an SQL based Bayes-DB. Having to change
something only in one place really makes life a lot easier for the
admin. And after all, there are thousands (uhm, millions) of people
doing system administration, but only a handfull which do init system or
daemon programming. So as someone else has put it: It should be the user
who is allowed to be lazy, not the program author, as there are way more
users to a program than there are programmers.

cu,
sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 186 bytes
Desc: OpenPGP digital signature
Url : http://lists.alioth.debian.org/pipermail/initscripts-ng-devel/attachments/20050829/16a1094f/signature.pgp


More information about the initscripts-ng-devel mailing list