Skip to content

Commit

Permalink
Fix aesmd booting error after RPM upgrade.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
yuguorui committed Jun 24, 2022
1 parent fdb3b8b commit 7523535
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion linux/installer/rpm/sgx-aesm-service/sgx-aesm-service.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7523535

Please sign in to comment.