Bug 14395

Summary: Postinstall scriptlets Error misleading with systemd errors
Product: [Build System, Metadata & Runtime] OE-Core Reporter: akuster <akuster808>
Component: coreAssignee: akuster <akuster808>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: meta.mr.watcher, meta.watcher, randy.macleod
Version: 5.99   
Target Milestone: 4.2   
Hardware: x86   
OS: Multiple   
Whiteboard: NIR 12/09, 12/16, 12/23, 12/30, 01/06
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description akuster 2021-05-15 16:49:04 UTC
ERROR: security-build-image-1.0-r0 do_rootfs: Postinstall scriptlets of ['clamav-daemon'] have failed. If the intention is to defer them to first boot,
then please place them into pkg_postinst_ontarget_${PN} ().
Deferring to first boot via 'exit 1' is no longer supported.
Details of the failure are in /home/build/builds/master/tmp/work/qemux86_64-poky-linux/security-build-image/1.0-r0/temp/log.do_rootfs.

The problem is a missing dependency in the systemd service file.

This is the error. 

__main__.SystemdUnitNotFoundError: (PosixPath('/home/build/builds/master/tmp/work/qemux86_64-poky-linux/security-build-image/1.0-r0/rootfs'), 'clamav-daemon.socket')
%post(clamav-daemon-0.104.0-r0.core2_64): waitpid(3635548) rc 3635548 status 100
warning: %post(clamav-daemon-0.104.0-r0.core2_64) scriptlet failed, exit status 1


Not sure if we can improve the Error to be more informative.

The recipe did have a "pkg_postinst_ontarget_" so it sent me off in a wild goose chase. 

Wonder if systemd_preset_all() could be more informative.
Comment 1 akuster 2021-06-01 13:51:52 UTC
patches sent to ML
Comment 2 Randy MacLeod 2022-11-03 15:12:44 UTC
Armin, 

Is this fixed now and if so, what are the patches?

../Randy
Comment 3 akuster 2023-01-10 17:11:33 UTC
(In reply to comment #2)
> Armin, 
> 
> Is this fixed now and if so, what are the patches?
> 
> ../Randy

yes.

https://git.yoctoproject.org/poky/commit/?id=75f691d728dba4de53f89cd7ce1cdb69e35000cf
Comment 4 Randy MacLeod 2023-01-10 18:54:45 UTC
Thanks Armin.