-
Notifications
You must be signed in to change notification settings - Fork 8
Command Restart
Use Case A: restarting a frontend service (no service depends on it) will just start/stop that single service. Note that after the restart the service will be up even if it was down before. All services it depends on will also be up afterwards (started if needed), but they will not be restarted.
Example with three services: front
depends on middle
which in turn depends on back
.
state before:
front UP middle UP back UP
restart service://host/front
will just restart front
state after:
front UP middle UP back UP
if in turn we'd have the (broken) state before:
front UP middle DN back UP
restart service://host/front
will restart front and fix the dependency:
state after:
front UP middle UP back UP
Use Case B: restarting a backend service will stop the service together with all services that depend on it and will then start all those services depending on it which had been running before.
state before:
front DN middle UP back UP
restart service://host/back` # back and middle will restart
state after:
front DN middle UP back UP
In contrast to other yadt commands, the 'restart' command is not idempotent. That means, if something goes wrong during restart, you should not retry to run the same command!
'restart' remembers all running services at the beginning of the command; after stopping the given service, all these services get started again. If 'restart' bails out during stopping or starting, the set of running services changes and therefore you do not get the same state as before the first try: In fact you will end up with some services not running. So do not retry 'restart', but use 'stop' and 'start' explicitly instead.