This document describes the different dependency types of cinit.

1. Dependencies in general

Each service may have two types (non-exclusive) types of dependencies: The so called needs or wants. These are directories below the service directory and contain symbolic links to the dependencies. The name of the link can be freely chosen.

An example:

The service /etc/cinit/svc/getty/2 needs the service /etc/cinit/svc/local-tuning/keyboard-layout:

[21:35] hydrogenium:needs# cd /etc/cinit/svc/getty/2/needs
[21:35] hydrogenium:needs# ls -l
insgesamt 0
lrwxrwxrwx 1 root root 37 2006-10-26 17:51 keyboard-layout -> ../../../local-tuning/keyboard-layout
[21:35] hydrogenium:needs# cd keyboard-layout/
[21:35] hydrogenium:keyboard-layout# pwd -P
/etc/cinit/svc/local-tuning/keyboard-layout

(Warning: This is an incomplete example, it misses at least mount/root as dependency)

This service could additionally want something else, too. It is also possible that a service only wants another service or that a service has no dependencies.

cinit does not care whether a link is relative or absolute. And as far as I can see it does not make any difference to usability.

In general, it seems to be a little bit easier to use relative links when manually configuring cinit (ln -s ../../../service versus ln -s /etc/cinit/svc/category/service), but easier readable when analysing them (with `ls -l').

2. The two types

2.1. needs

Needs are the hard dependencies: If a services fails to start that is linked in the needs directory, the service will not be started.

2.2. wants

Wants are the soft dependencies: cinit will try to start the dependencies found in wants before the service, but the service will also be started, indenpendend of success of the dependencies.

3. Circular dependency problem

If you manage to create circular dependencies cinit will fall into an endless loop. Use cinit.check.config to verify your configuration.