When I used yunohost tools regen-conf then these hooks did get used/applied successfully, and when I would run yunohost tools regen-conf --with-diff --force --dry-run again it would show nothing to be changed.
However, whenever I did something in the web interface that triggers conf_regen then the hook scripts were not used at all, so the config files went back to not have the modifications I want This even affected config files in other parts, for example modifying the URL path in the redirect app not only regenerated the nginx config files, but also /etc/postfix/main.cfwhere then the line compatibility_level=3.6 was no longer there as the above mentioned hook is no loner used. (The hooks were also ignored when some cron job once per day regenerated config files.)
After a lot of guessing I realized that my hook files did not follow the naming pattern that @abc explained in the above mentioned post. So this helped:
(And similar for other scripts, comparing the numbers and names to what is in /usr/share/yunohost/hooks/conf_regen.)
The question remainds why the CLI did then use the hooks even with the “wrong” names. Does this mean that the CLI is less picky and just runs all the hook scripts, no matter how they are named? Are there two different codepaths for what the CLI tool does and what the web UI does? My assumption before was that they would run the same things actually.
Thanks for the suggestion! In your test you are running yunohost tools regen-conf postfix which indeed will not use a wrongly named hook. But when running yunohost tools regen-conf to regenerate everything then also the wrong named hook gets used:
I guess some of the relevant code is here in regenconf.py where all_available_conf_regen_categories is used but It don’t understand how it all works.