Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] opensearch-2.12.0-linux-x64.rpm hangs on prein script #4528

Closed
guildin opened this issue Mar 7, 2024 · 7 comments · Fixed by #4542
Closed

[BUG] opensearch-2.12.0-linux-x64.rpm hangs on prein script #4528

guildin opened this issue Mar 7, 2024 · 7 comments · Fixed by #4542
Assignees
Labels
bug Something isn't working release rpm v2.13.0

Comments

@guildin
Copy link

guildin commented Mar 7, 2024

Describe the bug

opensearch package installation hangs while executing preinst script.

The following code in PREIN:

yum list installed opensearch

can't be used while executing yum install, because yum is already running and another instance of yum will be stucked like:

Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  91 M RSS (1.4 GB VSZ)
    Started: Thu Mar  7 13:04:21 2024 - 10:44 ago
    State  : Sleeping, pid: 31532

The following section:

if rpm -q opensearch >/dev/null 2>&1 || yum list installed opensearch >/dev/null 2>&1; then
    OPENSEARCH_ALREADY_INSTALLED="yes"
else
    OPENSEARCH_ALREADY_INSTALLED="no"
fi

can be refactored like:

%pre
...
if [ $1 -eq 1 ]; then
  #install
  OPENSEARCH_ALREADY_INSTALLED="no"
fi
if [ $1 -eq 2 ]; then
  #upgrade
  OPENSEARCH_ALREADY_INSTALLED="yes"
fi
...

rpm scriptlets reference: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/

Related component

Build

To Reproduce

yum install opensearch

Expected behavior

yum install opensearch able to complete installation

Additional Details

Host/Environment (please complete the following information):

  • OS: CentOS
  • Version 7.9.2009
@guildin guildin added bug Something isn't working untriaged Issues that have not yet been triaged labels Mar 7, 2024
@andrross
Copy link
Member

[Triage - attendees 1 2 3]
@opensearch-project/triage Can you transfer this issue to https://github.com/opensearch-project/opensearch-build ?

@andrross andrross removed the untriaged Issues that have not yet been triaged label Mar 13, 2024
@andrross
Copy link
Member

@bbarani bbarani transferred this issue from opensearch-project/OpenSearch Mar 13, 2024
@github-actions github-actions bot added the untriaged Issues that have not yet been triaged label Mar 13, 2024
@bbarani
Copy link
Member

bbarani commented Mar 13, 2024

Tagging @peterzhuamazon to take a look at this issue.

@peterzhuamazon peterzhuamazon added rpm and removed untriaged Issues that have not yet been triaged labels Mar 18, 2024
@peterzhuamazon peterzhuamazon self-assigned this Mar 18, 2024
@peterzhuamazon
Copy link
Member

peterzhuamazon commented Mar 18, 2024

This behavior does not happen on docker with systemd configured.
Tho it is something that will cause a conflict per logs, and confirmed on a full-ledge linux server.

Adding @DarshitChanpura @derek-ho to double check on this and potentially apply the suggested patch by @guildin.

Thanks!

@peterzhuamazon
Copy link
Member

I will remove the prein script changes in rpm, just like deb, so that deb and rpm are consistent here. @DarshitChanpura @derek-ho
All the checking will be passed to the postin script so that demo install script in security repo taken care of the behavior.

Thanks.

@DarshitChanpura
Copy link
Member

sounds good. I agree, let's keep it consistent.

@resetsa
Copy link

resetsa commented Mar 20, 2024

Please fix this for branch 1.x also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working release rpm v2.13.0
Projects
Development

Successfully merging a pull request may close this issue.

6 participants