Differences between revisions 7 and 8
Revision 7 as of 2007-06-13 10:10:13
Size: 2489
Editor: nomeata
Comment:
Revision 8 as of 2007-06-21 11:39:17
Size: 3136
Editor: nomeata
Comment: Current state of MetaInit
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
 * Some early hacking found on http://http://darcs.nomeata.de/metainit/ (http://darcs.nomeata.de/cgi-bin/darcsweb.cgi?r=metainit)  * Current Source http://http://darcs.nomeata.de/metainit/ (http://darcs.nomeata.de/cgi-bin/darcsweb.cgi?r=metainit)
 * You can find binaries and the debian source package on: http://people.debian.org/~nomeata/metainit
 * A description of the metainit file format (as perldoc): http://darcs.nomeata.de/cgi-bin/darcsweb.cgi?r=metainit;a=headblob;f=/lib/MetaInit/Parse.pm
 * Example metainit files: http://darcs.nomeata.de/metainit/examples/
 * A descriptions of the steps to upgrade a package to metainit: http://darcs.nomeata.de/metainit/doc/converting.txt
 * A debian directory of a simple daemon (without debhelper): http://infon.dividuum.de/trac/browser/trunk/contrib/debian?rev=208
 * A debian directory of a simple daemon (with debhelper): http://infon.dividuum.de/trac/browser/trunk/contrib/debian?rev=210
Line 12: Line 18:
== Protocol from DebConf 7 BoF == == Problem to solve ==
Line 14: Line 20:
=== Current Problems ===
 * Debian supports only Sys-V-Init
 * Other systems hard to support get packages to provide init scripts
 * Changes (bug or features) in lots of init scripts are hard to do
A lot of packages ship init scripts, and most
of these scripts are both not very well cared for (just copy’n’pasted
and slightly adjusted) and also very similar. Fixing this is hard, and so is introducing new features to all init scripts.
Line 19: Line 24:
=== Solution ===
Packages ship simple “metainit” files that contain the minimal information needed to create init scripts for (hopefully) any init system. We only want to support the normal, simple case, any daemon with special needs still has to write the init scripts themselves
== Outline of metainit ==
Line 22: Line 26:
=== Scripts generated at build or install time ===
 * gwolf: Use dpkg-trigger
 * gwolf: Easier to implement changes (no recompilation needed)
 * panthera: add additional build dependency which handle the registration/generation of init scripts
 * nomeata: we need it on client side to resolve dependecies to svs-v
'''Consenus: workstation side'''
=== Metainit compromises of ===
 * A small declarative file format to describe the daemon, to be shipped by the package (or created by a local admin)
 * A meatinit package that creates init scripts (or, yet to be written, upstart jobs) from these files
 * A dh_metainit scripts to ease the inclusion of metainit files in your package, that adds appropriate maintainer script snippets.
Line 29: Line 31:
In a way, metainit is a mixture of the menu system and cdbs, for init
scripts.
Line 30: Line 34:
=== What features (metainit file field) to be supported? ===
 * daemon name / description
 * how to start, forking or non-forking?
  * required: non-forking start
  * others not at the moment, maybe implemented later
 * Dependencies according to the LSB standard, but without Default-Start and Default-Stop, see:
   http://refspecs.freestandards.org/LSB_2.1.0/LSB-generic/LSB-generic/initscrcomconv.html
 * uid/gid
 * hooks (inline /bin/sh fragments)
   - pre-start
   - post-stop
 * reload/restart functionality:
   - default: stopping and starting
   - optionally: specifying a signal
=== The advantages of this system are ===
 * '''For the package maintainer:'''
  * No need to manually create and maintain init scripts or upstart jobs
 * '''For Debian:'''
  * More consistent init scripts in the distribution
  * Easier to add new features (e.g. lsb output), without recompilation of packages
 * '''For the ubuntu/debian relationship:'''
  * The same package could be used unmodified in Debian (creating sysvinit scripts) and ubuntu (upstart jobs)
 * '''For ubuntu:'''
  * It could help to ease the transition to a pure upstart based system.
 * '''For the user:'''
  * Can create “good” init scripts for custom daemons with just one line in one file and one command (update-metainit)
Line 45: Line 47:
=== Implementation details ===
 * metainit files to be conffiles, therefore user editable
 * generated files are deleted only when the package is removed in remove (not only in purge)
 * maybe non-protective comments in generated files
 * Problem: What happens if a new version stopps using our scheme...

=== Helpers ===
 * ["nomeata"] will try to start some code
 * MikkoTorni will care about the runit side

=== TODO ===
 * Define metainit file format
 * update-metainit
 * metainit-sysvinit
=== What this system is not meant for ===
Replacing all init script in packages. We (at least currently) will only
support “simple” daemons (no very special dependencies, no strange ways
of starting or stopping them, no forking mode supported, forking is done
by the init script or upstart). We do hope to make metainit work for the
“boring” 80%-90% of init scripts. All other packages are welcome to
continue doing what they did before.

Summary

A project to provide an infrastructure for automatic init script generation in simple cases.

Problem to solve

A lot of packages ship init scripts, and most of these scripts are both not very well cared for (just copy’n’pasted and slightly adjusted) and also very similar. Fixing this is hard, and so is introducing new features to all init scripts.

Outline of metainit

Metainit compromises of

  • A small declarative file format to describe the daemon, to be shipped by the package (or created by a local admin)
  • A meatinit package that creates init scripts (or, yet to be written, upstart jobs) from these files
  • A dh_metainit scripts to ease the inclusion of metainit files in your package, that adds appropriate maintainer script snippets.

In a way, metainit is a mixture of the menu system and cdbs, for init scripts.

The advantages of this system are

  • For the package maintainer:

    • No need to manually create and maintain init scripts or upstart jobs
  • For Debian:

    • More consistent init scripts in the distribution
    • Easier to add new features (e.g. lsb output), without recompilation of packages
  • For the ubuntu/debian relationship:

    • The same package could be used unmodified in Debian (creating sysvinit scripts) and ubuntu (upstart jobs)
  • For ubuntu:

    • It could help to ease the transition to a pure upstart based system.
  • For the user:

    • Can create “good” init scripts for custom daemons with just one line in one file and one command (update-metainit)

=== What this system is not meant for === Replacing all init script in packages. We (at least currently) will only support “simple” daemons (no very special dependencies, no strange ways of starting or stopping them, no forking mode supported, forking is done by the init script or upstart). We do hope to make metainit work for the “boring” 80%-90% of init scripts. All other packages are welcome to continue doing what they did before.