From bc31f6dd0fc5234eb62de884aa7a7a8686630d05 Mon Sep 17 00:00:00 2001 From: Coiby Xu Date: Thu, 16 Nov 2023 10:19:19 +0800 Subject: [PATCH] Let %post scriptlet always exits with the zero exit status MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2247940 Currently, CoreOS image fails to be built. This is because since commit 00c37d8c ("spec: Drop special handling for IA64 machines"), the last command is now servicelog_notify and it fails to run in such invocation environment. Thus the %post scriptlet returns a non-zero exit code which breaks package installation, Running scriptlet: kexec-tools-2.0.27-4.fc40.ppc64le /proc/ is not mounted. This is not a supported mode of operation. Please fix your invocation environment to mount /proc/ and /sys/ properly. Proceeding anyway. Your mileage may vary. servicelog_notify: is not supported on the Unknown platform warning: %post(kexec-tools-2.0.27-4.fc40.ppc64le) scriptlet failed, exit status 1 Error in POSTIN scriptlet in rpm package kexec-tools Quoting [1], > Non-zero exit codes from scriptlets can break installs/upgrades/erases > such that no further actions will be taken for that package in a > transaction (see Ordering), which may for example prevent an old version > of a package from being erased on upgrades, ... > > All scriptlets MUST exit with the zero exit status. Because RPM in its > default configuration does not execute shell scriptlets with the -e > argument to the shell, excluding explicit exit calls (frowned upon with > a non-zero argument!), the exit status of the last command in a > scriptlet determines its exit status... > > Usually the most important bit is to apply this to the last command > executed in a scriptlet, or to add a separate command such as plain “:” > or “exit 0” as the last one in a scriptlet. Following the above suggestion, add a separate command ":" as the last one to the %post scriptlet. [1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/ Reported-by: Colin Walters Cc: Dusty Mabe Cc: Philipp Rudo Fixes: 00c37d8c ("spec: Drop special handling for IA64 machines") Signed-off-by: Coiby Xu Reviewed-by: Philipp Rudo --- kexec-tools.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/kexec-tools.spec b/kexec-tools.spec index cb1a408..19b0b69 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -271,6 +271,7 @@ touch /etc/kdump.conf servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh 2>/dev/null servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin >/dev/null %endif +: %postun