66
www.obarun.org
66-start
This command starts one ore more services defined in tree.
Interface
66-start [ -h help ] [ -v verbosity ] [ -l live ] [ -t tree ] [ -T timeout ] [ -r reload ] service(s)"
This tool expects to find an already enabled service inside the given tree and an already running scandir.
If the state of the service is already up, 66-start do nothing execpt in case of -r option—see reload transition.
Multiple services can be started by seperating their names with a space.
Options
- -h : prints this help.
-
-v verbosity : increases/decreases
the verbosity of the command. 1(Default): Only print
error messages. 2: Also print warning messages.
3: Also print debugging messages.
-
-l live : changes the supervision directory of service to live. By default this will be /run/66. The default can
also be changed at compile time by passing the --livedir=live
option to ./configure. An existing absolute path is expected and
should be within a writable filesystem - likely a RAM filesystem—see 66-scandir.
-
-t tree : starts the service from
the given tree. This option is mandatory
except if a tree was marked as 'current'—see 66-tree.
-
-T timeout : specifies a timeout (in milliseconds)
after which 66-start will exit 111 with an error message if the service still hasn't reached the up state.
By default, the timeout is 1000.
-
-r : reload the service—see reload transition.
Dependencies handling
In case of 'bundle', 'longrun' or 'oneshot' services, the dependencies chain will be automatically resolves.
It is unnecessary to manually define chained sets of dependencies. If FooA have a declared dependency FooB,
FooB will be automatically added to the chain at FooA starting process and FooB will be started first.
This is done recursively.
Classic services transitions
-
66-start computes the arguments services in one list of classic services called selection.
-
Inspect the selection to determine if the service is already initiate.
If not, a new selection is made. It copy verbatim the files and directories of the selection,
create a down file and the event fifo directory. It subscribe to the service fifo events,
send a reload signal to the scandir and wait for an events for every service on the selection.
If a timeout occurs before an events reception, the initialization fail.
-
If a reload was asked, a reload transition is operated.
-
Inspect the selection and look if a looger is associated for a service.
If yes, it add the logger service to the selection.
-
Finally it send an 66-svctl -v verbosity -T timeout -l live -t tree -U selection command
and wait for the exit code status of command.
Obviously, if one of those process fail 66-start fail too and exit 111.
Bundle,longrun,oneshot transitions
-
66-start computes the arguments services in one list of Bundle,longrun,oneshot services called selection.
-
Inspect the selection to determine if the associated service database of the tree
is already initiated. If not an 66-init -v verbosity -l live -d tree is invoked and
wait for the exit status code of the command. Than a reload signal
is send to the scandir to prevents it about the change.
-
If a reload was asked, a reload transition is operated.
-
Finally it send an 66-dbctl -v verbosity -T timeout -l live -t tree -u selection command
and wait for the exit status code of the command.
Obviously, if one of those process fail 66-start fail too and exit 111.
Reload transitions
Classic
-
66-start computes the arguments services in one list of classic services called selection.
-
It look after the logger of the service if exist and add it to the selection,
send an 66-svctl -v verbosity -T timeout -l live -t tree -D selection command
and wait for the exit status of the command. It removes all
files and directories of service from the scandir than an init transition is operated—see above.
Obviously, if one of those process fail 66-start fail too and exit 111.
Bundle,longrun,oneshot
-
66-start computes the arguments services in one list of Bundle,longrun,oneshot services called selection.
-
It make a backup of the live service database of the tree and switch to this one with
the help of s6-rc-update program.
-
Compile the service database of the tree from the source with the help of s6-rc-compile
program.
-
Switch the live service database of the tree to this new fresh compiled database.
Send an 66-dbctl -v verbosity -l live -t tree -d selection command.
-
Finally performs an 66-dbctl -v verbosity -T timeout -l live -t tree -u selection command
and wait for the exit status code of the command.
Obviously, if one of those process fail 66-start fail too and exit 111.