Tie in service and condition documents with README

This is a first effort at cleaning up and consolidating all information
about the new service state machine and how conditions control this
state machine.

Also, clarified and added sections for all documents regarding how
services and conditions relate.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-07-14 16:08:44 +02:00
1 parent 6ff9cb2ff3
commit 1c0776b818
3 files changed
+78 -44

No files matched your search

+20 -15
View File
@@ -1,29 +1,34 @@
# Services
Finit Services
==============
## State Machine
![The service state machine](svc-machine.png "The service state machine")
![A service's state machine](svc-machine.png "A service's state machine")
State Machine
-------------
A service is bound to a state machine that is in one of six (6)
states. For `run`s and `task`s there is an additional end state called
`DONE`, not shown in the diagram for brevity. All services start in
the `HALTED` state.
A service is bound to a state machine that is in one of six (6) states.
For `run`s and `task`s there is an additional end state called `DONE`,
not shown in the diagram for brevity. Services start in the `HALTED`
state.
The current state depends on the two following conditions:
* `E`: Service enabled. In order for `E` to be satisfied, the service
must be allowed to run in the current runlevel and must not be
blocked. A service may be blocked for several reasons:
- The user has manually stopped the service using `initctl stop
JOB`.
- The binary repeatedly dies after being started. I.e. keeps
crashing.
blocked. A service may be blocked for several reasons:
- The user has manually stopped the service using `initctl stop JOB`
- The binary repeatedly dies after being started. I.e. keeps crashing.
- The binary is missing in the filesystem.
* `C`: Service conditions are satisfied.
* `C`: Service conditions are satisfied:
- `on` (+): The condition is asserted.
- `off` (-): The condition is deasserted.
- `flux` (~): The conditions state is unknown.
For a detailed description of conditions, and how to debug them,
see the [Finit Conditions](conditions.md) document.
<!--
-- Local Variables: