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:
-
installs the
c-osquerysnap from the configuredsnap-channeland applies the initial configuration. -
re-runs the reconcile after a charm upgrade.
-
reconciles when the unit starts.
-
rebuilds the flagfile and secret files whenever an option changes, then restarts the daemon.
-
re-reads a Juju secret (for example the enrollment secret or TLS client key) when its content is updated, and re-applies the configuration.
-
periodically reconciles so the unit self-heals and reports accurate status.
stop:
removes the
c-osquerysnap (which stops the daemon) and purges its data during tear-down.
See also
See more in the Juju docs: Hook