When I look at the juju documentation I do not see a "Destroy" or "uninstall" hook. So I'm wondering what the juju destroy-service
command does exactly.
Does it remove any of the config files? Uninstall programs? Remove containers? Or just stop the service?
This can be somewhat context sensitive, and I'll try to outline that here.
juju destroy service
does a few things. First it sends a command to the juju state server that every unit in this service group is to be destroyed. This then has a chain reaction into the following events:The charm breaks any relationships to its service that are established which calls:
The charm calls its own stop hook - and this is where it gets context sensitive.
The stop hook is typically responsible for a few concerns.
The service is then removed from the juju topology, along with any units that made up that service group.
The resulting machine is tagged dirty so it's not reused for a new deployment and left in the environment for you, the orchestrator, to fetch any leftover data if you wish, and can then be terminated with:
The # being the unit number of the machine.