Files
finit/doc/service.md
T
Joachim Wiberg b3ea23ed26 initctl: drop old 'job:id' format support, canonical is 'name:id'
With the recent changes to the condition handling it has become more and
more evident that the canonical reference for a task/run/service is the
NAME:ID representation.  Up until now we've kept the older JOB:ID for
some sort of compatibility fallback.

This patch removes the support to simplify maintenance going forward.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2021-03-04 07:23:19 +01:00

1.1 KiB

Finit Services

The service state machine

State Machine

A service is bound to a state machine that is in one of six (6) states. For runs and tasks 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 not be stopped.

    A service may be stopped, or blocked, for several reasons:

    • The user has manually stopped the service using initctl stop NAME
    • The program exits immediately. I.e. keeps crashing (make sure to use the 'run this service in the foreground' command line option)
    • The binary is missing in the filesystem
  • C: Service conditions are satisfied:

    • on (+): The condition is asserted.
    • off (-): The condition is deasserted.
    • flux (~): The condition state is unknown.

For a detailed description of conditions, and how to debug them, see the Finit Conditions document.