Ubuntu: How do I gracefully shutdown a Juju Charm?



Question:

My charm controls a service that can detect when it's no longer needed, and should shut itself down. Is there a defined way to shutdown the system in a way that Juju considers appropriate? Can I just shutdown -h now on the system?


Solution:1

to destroy a unit

juju remove-unit unit_name/1  

or for a service (kills all units, breaks relations, etc)

juju destroy-sevice  

to clean up unused machines after either of the above (doesn't apply to local providr)

juju terminate-machine  

at the moment (6/2012) the service does not receive notification of its impending destruction. when this capability exists the service will be asked to execute its stop hook prior to destruction.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »