Skip to content

Instantly share code, notes, and snippets.

@kapilt
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kapilt/3cc7dc715aaee12aa480 to your computer and use it in GitHub Desktop.
Save kapilt/3cc7dc715aaee12aa480 to your computer and use it in GitHub Desktop.
api for unit agent request shutdown on self machine (triggered by hook exit value)
api for unit agent to watch for shutdown on machine
-> on receipt
stops further hook exec / blocking on the current one if any
signals ready for shutdown
api for unit agent to signal ready for shutdown
api for machine agent watch for shutdown
-> on shutdown recieved
-> disables unit deployment
-> informs all units of pending shutdown [ could also be done by requesting agent, but supervision tree looks nicer from child->parent-> children]
-> initiates watch on all units on machine to reach shutdown ready state
-> upon all units marked ready for shutdown, restarts the machine.
also needs to execute stop hooks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment