Need a consistent set of hook events surrounding stop/start of application unit (ie. reboots)
Bug #1844773 reported by
Ryan Beisner
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
In our work surrounding power events such as planned and unplanned reboots of units, we've discovered that there is no consistent hook on which we can depend for post-reboot requirements.
We've found that the leader-
In order to give charm authors a facility to consistently handle lifecycle management operations, Juju should provide a consistent set of hook events surrounding stop/start of application units.
summary: |
- no dependable hook for start of a unit (ie. hook context after reboot) + Need a consistent set of hook events surrounding stop/start of + application unit (ie. reboots) |
Changed in juju: | |
status: | Expired → Triaged |
importance: | Undecided → High |
To post a comment you must log in.
We used to have config-changed trigger whenever a unit agent was restarted, but the feedback was that caused outages because of charms that force restarted their application whenever the hook was called (regardless of whether there was actual change relative to the last config of the application.)
I'm curious what actual event you're looking for/what you want to do in "machine was restarted".
Wouldn't that be a systemd process that starts your instance?
leader- settings- changed certainly doesn't seem reliable for this. It might only be triggering for the same reason that config-changed used to trigger (during initialization we just assume NewValue != UnknownExisting Value).
It would be good to concretely understand what you're looking to run/alert/do something. (Generally we don't recommend starting an application process directly as a result of a hook, vs the hook configuring a systemd service. Otherwise there isn't any way that you would guarantee if the service dies it would get restarted, as there may be no Juju Model lifecycle event that would trigger another hook.)