From 7523535879711e3659ef28bf3c00877dd51d7cb2 Mon Sep 17 00:00:00 2001 From: yuguorui Date: Tue, 21 Jun 2022 16:26:57 +0800 Subject: [PATCH] Fix aesmd booting error after RPM upgrade. According to the spec [1], the scriptlet %post of a new package executes before %preun of the old package. This will cause the startup.sh of the new package to be executed first, and then the cleanup.sh of the old package to be executed when sgx-aesm-service is upgraded, and the user aesmd will be deleted, which leading aesmd booting error. Replace %post with %posttrans to make sure the prerequisites for service aesmd are met. [1]. https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/ Signed-off-by: yuguorui --- linux/installer/rpm/sgx-aesm-service/sgx-aesm-service.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/installer/rpm/sgx-aesm-service/sgx-aesm-service.spec b/linux/installer/rpm/sgx-aesm-service/sgx-aesm-service.spec index d8a0265d6..581012c57 100644 --- a/linux/installer/rpm/sgx-aesm-service/sgx-aesm-service.spec +++ b/linux/installer/rpm/sgx-aesm-service/sgx-aesm-service.spec @@ -67,7 +67,7 @@ sed -i 's#^/etc/aesmd.conf#%config &#' %{_specdir}/list-%{name} %files -f %{_specdir}/list-%{name} -%post +%posttrans if [ -x %{_install_path}/startup.sh ]; then %{_install_path}/startup.sh; fi %preun