Bug 11096 - improve pkg_postinst handling: script errors should be properly reported
Summary: improve pkg_postinst handling: script errors should be properly reported
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: deployment (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ enhancement
Target Milestone: Future
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on: 9675
Blocks:
  Show dependency tree
 
Reported: 2017-02-22 19:27 UTC by Alexander Kanavin
Modified: 2018-01-31 10:16 UTC (History)
1 user (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kanavin 2017-02-22 19:27:50 UTC
Currently if anything goes wrong in pkg_postinst() script, the problem is swept under a carpet in two ways:
1) scripts are not run using sh -e, so only the if the last command in a script fails, the script fails.
2) even if the script does fail, it's taken as a request to defer the script execution to first boot of the image, which may mask a problem or a regression somewhere. Deferral to first boot needs to be requested explicitly by calling a 'hook' command from the script.

I've done some work to address this here, needs to be completed:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=akanavin/dnf-rpm4-postinst-fix

Discussion:
http://lists.openembedded.org/pipermail/openembedded-architecture/2017-February/000422.html
Comment 1 Richard Purdie 2017-11-08 16:23:09 UTC
Related to https://bugzilla.yoctoproject.org/show_bug.cgi?id=9261
Comment 2 Alexander Kanavin 2018-01-31 10:16:52 UTC
Patchset merged to master:
http://lists.openembedded.org/pipermail/openembedded-core/2018-January/146895.html