Add One-shot Install/Uninstall Hook
Bug #1661126 reported by
Matt Middleton
This bug affects 9 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Released
|
Undecided
|
Paweł Stołowski |
Bug Description
It would be nice to have a hook that is executed once on install / uninstall ( and possibly upgrade ) and that is guaranteed to run before any daemons are launched. This would allow for configs, databases, etc to be properly configured for daemons that require it. I'm currently snapping a daemon that I'm unable to modify and would benefit very much from this addition and I assume this would also benefit people that need to snap daemons that are not rewritten exclusively for the snap environment as well as 'classic mode' daemons that need to setup other parts of the system, users, etc..
affects: | snapd (Ubuntu) → snapd |
tags: | added: conjure |
Changed in snapd: | |
assignee: | nobody → Paweł Stołowski (stolowski) |
To post a comment you must log in.
Yes, I've run into this challenge making snaps too.
The only question in my mind, though, is whether you don't actually want
to run a sanity check of config etc on every launch, anyway, to deal
with cases of corruption. What I did was sanity check config and restore
if needed (or recreate from a template) when the daemon is being
launched. That would slow down launch slightly but provide a very high
level of certainty on every launch.
Mark