Closed yalh76 closed 5 years ago
Dunno if that's really a clear explanation because that's tricky to explain but if you're around in the brique camp during the week I can tell you more about it ;P
Thanks for the informations, I will look at it. I hope to be at the brique camp on Wednesday night and maybe Thursday
Uuuuh I think you should consider having a look at the yunohost conf regen hook to see how they work.
so for instance here : https://github.com/YunoHost/yunohost/blob/stretch-unstable/data/hooks/conf_regen/12-metronome#L60-L74
You should feed
$4
(the 'pending conf dir') todo_pre_regen
and use it instead of defining your own temp_dir.In fact ... the metronome hook runs before your hooks and the whole thing should looks something like :
1. core Metronome pre_regen, puts file in `${pending_dir}/etc/metronome` 2. your app pre_regen, should probably edit/patch the conf already in `${pending_dir}/../metronome/etc/metronome` (or maybe add additional files, idk your use case precisely). * for an example, check mailman [here](https://github.com/YunoHost-Apps/mailman_ynh/blob/master/sources/hooks/conf_regen/98-postfix_mailman#L9-L16) 3. ...yunohost decide or not to actually apply the conf from ${pending_dir} or not, c.f. the --dry-run option where the conf is generated but not actually applied in the "true" directories... 4. core post_regen (where it reloads the service possibly or fix some permission and other weird stuff _but it has nothing to do anymore about writing conf files_ anymore !) 5. your app post_regen ... i'm quite sure that you have nothing to do in it
@alexAubin
I have completely review the hook.
I you can have a little look before merging
Problem
yunohost tools regen-conf --force
, metronome specific config is trashedSolution
PR Status
Package_check results