| Summary: | RPM leaks pre-/postinstall scripts to /var/tmp | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Olof Johansson <olof.johansson> | ||||
| Component: | Scripts and Tools | Assignee: | Olof Johansson <olof.johansson> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | Medium | CC: | alex.kanavin, olof.johansson, richard.purdie, ross.burton | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 2.6 M2 | ||||||
| Hardware: | All | ||||||
| OS: | Multiple | ||||||
| Whiteboard: | |||||||
| OS type for building Yocto: | --- | Type of Regression: | --- | ||||
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |||||
| Attachments: |
|
||||||
Forgot to mention: the leakage seems to happen during do_rootfs for RPM based images. Hi, I think the best solution would be to apply this patch against rpm-native only. Could you send the patch please? Sure thing! I'll take a look at it on Monday, if not before. Happy midsummer... :-) Patch submitted! After with discussion with Alexander Kanavin, a variant of the patch I attached was accepted and is now integrated on master (poky 6d3617). The cause of this issue was related to how OE "chroots" rpm into the target sysroot, but this is not possible for all pre/postinst scriptlets, so the chrooting is avoided in this case. That leaves rpm writing tmp files in the host's /var/tmp. We now remove them even if we are running with debug output from rpm. |
Created attachment 4327 [details] Always remove written tmp scriptlets When running rpm with debug output enabled (as is the case when run from oe.package_manager), rpm will not clean up created scriptlet files as generated by mktemp "/var/tmp/rpm-tmp.XXXXXX" (see lib/rpmscript.c). (Since this is not cleaned in any other way, the list of rpm-tmp files just keep growing until our developers face "out of free space" issues, because of no more free inodes.) By patching rpm to make the removal unconditional, the problem goes away, but probably not the prettiest fix. Attaching such a patch only for reference. This behavior was seen at least on Rocko and master (poky 0beae33, current at the time of writing).