66
www.obarun.org
66-stop
This command stops one ore more services defined in tree.
Interface
66-stop [ -h help ] [ -v verbosity ] [ -l live ] [ -t tree ] [ -T timeout ] [ -u unsupervise ] service(s)
This tool expects to find an already enabled service inside the given tree and started inside an already running scandir.
If the state of the service is already down, 66-stop does nothing.
Generally speaking this command is the strict opposite of the 66-start tool.
Multiple services can be stopped 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 : stops 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-stop will exit 111 with an error message if the service still hasn't reached the up state.
By default, the timeout is 1000.
-
-u : unsupervise the service.
Remove the service directory from the scandir at the end of the stop process. This options has only effect for service as 'classic' type.
Dependencies handling
In case of 'bundle', 'longrun' or 'oneshot' services, any dependency chain will be resolved automatically.
It is unnecessary to manually define chained sets of dependencies. If FooA has a declared dependency on FooB,
FooB will be automatically considered and stopped first when stopping FooA.
This will run recursively until all dependencies are stopped.
Classic service transitions
-
66-stop gathers the classic service(s) passed as argument in a list called selection.
-
The selection is inspected and searched for any logger that needs to be associated with the passed service.
If any such instruction was found the corresponding logger service will be added to the selection as well.
-
The command sends a 66-svctl -v verbosity -T timeout -l live -t tree -D selection
and waits for the resulting exit code.
-
Finally the service directory is removed from the scandir in case of 'classic' service type.
If any one of these processes fails then as a result 66-stop fails too and exits with code 111.
Bundle, longrun, oneshot transitions
-
66-stop gathers the bundle, longrun and/or oneshot service(s) passed as argument in a list called selection.
-
The selection is inspected and searched for any logger that needs to be associated with the passed service.
If any such instruction was found the corresponding logger service will be added to the selection as well.
-
Finally the command sends a 66-dbctl -v verbosity -T timeout -l live -t tree -d selection
and waits for the resulting exit code.
If any one of these processes fails then as a result 66-start fails too and exits with code 111.