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

I am trying to understand the hooks for a juju charm, some of them are rather obvious and easy to understand (start, stop, install,etc), others not really.

How many hooks are there, when are they called, for what function?

I am looking for a good list of hooks and their descriptions.

share|improve this question
up vote 5 down vote accepted

The documentation for all available hooks is available here:

The basic lifecycle (install, start, stop) and relation hooks are documented under charms. Relation hooks are defined for every relation a charm defines in its metadata.

Beyond those there are two other hooks of interest, the 'upgrade-charm' hook, which is called when a service's charm is upgraded for each of its service units.

The other is the 'config-changed' hook, called when a charm which defines a service configuration schema has its configuration changed, since services can be deployed with configuration data, the config-changed hook is also invoked upon the initial deploy of a unit prior to starting it.

all hooks are optional.

share|improve this answer

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.