66
www.obarun.org
66-stop
This command stops one ore more services defined in tree.
Interface
66-stop [ -h ] [ -v verbosity ] [ -l live ] [ -t tree ] [ -T timeout ] [ -u ] [ -X ] [ -K ] service(s)
The service to be stopped is expected to be enabled 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 66-start.
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 tracing messages.
4: Also print debugging messages.
-
-l live : changes the supervision directory of service to live. By default this will be %%livedir%%. 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 service in
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;
defaults to 1000.
-
-u : unsupervise the service.
Remove the service directory from the scandir at the end of the stop process. This option only applies to services of type 'classic'.
-
-X : exit. The supervisor of the service will exit too. This command should normally never be used on a working system.
-
-K : sends a SIGKILL to the service and keep it down.
Dependency handling
For services of type 'bundle', 'longrun' or 'oneshot' any existing dependency chain will be resolved automatically.
It is unnecessary to manually define chained sets of dependencies. If FooA has a declared dependency on another service with the name FooB then FooB will be automatically considered and stopped first when stopping FooA.
This works 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 then inspected and searched for any logger that may be associated with the passed service(s).
If any such instruction was found the corresponding logger will be added to the selection as well.
-
The command continues issueing 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.
If any one of these processes fails then as a result 66-stop fails too and exits with code 111.
Bundle, longrun, oneshot transitions
The process for these service types is very similar to that of classic services except for the automated command that adapts accordingly.
-
66-stop gathers the bundle, longrun and/or oneshot service(s) passed as argument in a list called selection.
-
The selection is then inspected and searched for any logger that may be associated with the passed service(s).
If any such instruction was found the corresponding logger will be added to the selection as well.
-
Finally the command issues 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-stop fails too and exits with code 111.