Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
This is what I'd type on my laptop, but doing that in the charm seems to be more difficult. I'm currently looking at the juju charm for doing that, but it doesn't seem to be quite working. And I'm not sure how Juju will handle the recursive call to kill the charm calling it. – Ted Gould Jun 13 '12 at 15:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.