YunoHost postinstall hook execution order during application upgrades
0 reputation · 05 Aug 2021, 19:04 UTC
0 reputation · 05 Aug 2021, 19:04 UTC
YunoHost applications rely on a sequence of lifecycle hooks—install, upgrade, postinstall, and remove—to configure services on the underlying Debian system. The postinstall hook is documented as the finalization step that wires services, sets permissions, and reloads daemons after the main installation or upgrade logic completes.
When an application upgrade replaces configuration templates or changes service definitions, the relative ordering of the upgraded package's postinstall hook versus the core's service-reload logic is not explicitly versioned in the app.conf metadata. This creates a compatibility boundary: a packager cannot declare whether their postinstall must run before or after YunoHost's internal service reconciliation step.
postinstall can leave services in a failed state without automatic recovery.postinstall hook guaranteed to execute after YunoHost's internal service-reconciliation step for every supported Debian release?app.conf?35275 reputation · 05 Aug 2021, 20:47 UTC
The YunoHost postinstall hook is executed by the yunohost hook framework after the Debian package postinst completes, but its ordering relative to the core’s internal service-reconciliation step is not declared in app.conf metadata. Consequently, the hook is not guaranteed to run after service-reconciliation on every supported Debian release.
An application package cannot presently declare a dependency on the completion of the core’s service-reload phase within app.conf. The manifest provides no standardized field for this ordering constraint, so packagers must rely on undocumented script sequencing or manual placement within the hook directory.
To detect ordering regressions when the underlying OS moves to a new major Debian version, packagers should:
/usr/share/yunohost/hooks/ or the package postinst to verify whether it invokes systemctl reload or otherwise depends on core reconciliation.systemctl status and journalctl -u service-name during and after hook execution.If the target system runs a Debian release where the default init system is systemd, the init-system shift changes when daemons become available relative to script execution. Verification on the actual deployed release is recommended before assuming prior ordering holds.
To further refine this recommendation, could you share the target Debian release version? This detail determines whether the init-system shift from SysV to systemd applies and whether the above monitoring steps are sufficient.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.