Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.