Juju eventsΒΆ

The charm follows a holistic (reconcile) pattern: nearly every lifecycle event is routed to a single idempotent handler that ensures osquery is installed, renders the flagfile from the current configuration, and (re)starts the daemon.

The following Juju events are observed:

  1. install:

    installs the c-osquery snap from the configured snap-channel and applies the initial configuration.

  2. upgrade-charm:

    re-runs the reconcile after a charm upgrade.

  3. start:

    reconciles when the unit starts.

  4. config-changed:

    rebuilds the flagfile and secret files whenever an option changes, then restarts the daemon.

  5. secret-changed:

    re-reads a Juju secret (for example the enrollment secret or TLS client key) when its content is updated, and re-applies the configuration.

  6. update-status:

    periodically reconciles so the unit self-heals and reports accurate status.

  7. stop:

    removes the c-osquery snap (which stops the daemon) and purges its data during tear-down.

See also

See more in the Juju docs: Hook