3

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?

Ted Gould
  • 3,425
  • 15
  • 23

1 Answers1

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.

Jorge Castro
  • 70,934
  • 124
  • 466
  • 653
Kapil Thangavelu
  • 1,042
  • 5
  • 3
  • 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