Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

elasticsearch user and group cannot be removed on RPM removal if performance analyzer is running #310

Open
sbruno opened this issue Apr 20, 2021 · 0 comments

Comments

@sbruno
Copy link

sbruno commented Apr 20, 2021

When removing elasticsearch-oss and all OpenDistro dependencies, elasticsearch user and group are tried to be removed but fail because the user is still running the performance analyzer.

Though the RPM preun script does a systemctl stop elasticsearch which also stops the performance analyzer since it is a dependency, it is still up when the postun script tries to remove the user and group.

Adding After=elasticsearch.service to opendistro-performance-analyzer.service worked for me, but I'm not sure if altering the service start order could affect negatively in some way to the performance analyzer.

This is the output I get when removing elasticsearch-oss while performance analyzer and elasticsearch services are up on Centos7:

[root@host3 vagrant]# yum remove elasticsearch-oss.x86_64 
Loaded plugins: fastestmirror
Resolving Dependencies
--> Running transaction check
---> Package elasticsearch-oss.x86_64 0:7.10.2-1 will be erased
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-alerting-1.13.1.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-index-management-1.13.2.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-anomaly-detection-1.13.0.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-security-1.13.1.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistroforelasticsearch-1.13.2-1.x86_64
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-sql-1.13.2.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-knn-1.13.0.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-performance-analyzer-1.13.0.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-job-scheduler-1.13.0.0-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-asynchronous-search-1.13.0.1-1.noarch
--> Processing Dependency: elasticsearch-oss = 7.10.2 for package: opendistro-reports-scheduler-1.13.0.0-1.noarch
--> Running transaction check
---> Package opendistro-alerting.noarch 0:1.13.1.0-1 will be erased
---> Package opendistro-anomaly-detection.noarch 0:1.13.0.0-1 will be erased
---> Package opendistro-asynchronous-search.noarch 0:1.13.0.1-1 will be erased
---> Package opendistro-index-management.noarch 0:1.13.2.0-1 will be erased
---> Package opendistro-job-scheduler.noarch 0:1.13.0.0-1 will be erased
---> Package opendistro-knn.noarch 0:1.13.0.0-1 will be erased
---> Package opendistro-performance-analyzer.noarch 0:1.13.0.0-1 will be erased
---> Package opendistro-reports-scheduler.noarch 0:1.13.0.0-1 will be erased
---> Package opendistro-security.noarch 0:1.13.1.0-1 will be erased
---> Package opendistro-sql.noarch 0:1.13.2.0-1 will be erased
---> Package opendistroforelasticsearch.x86_64 0:1.13.2-1 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================
 Package                              Arch        Version         Repository                                       Size
========================================================================================================================
Removing:
 elasticsearch-oss                    x86_64      7.10.2-1        @elasticsearch-7.x                              401 M
Removing for dependencies:
 opendistro-alerting                  noarch      1.13.1.0-1      @opendistroforelasticsearch-artifacts-repo       14 M
 opendistro-anomaly-detection         noarch      1.13.0.0-1      @opendistroforelasticsearch-artifacts-repo      9.7 M
 opendistro-asynchronous-search       noarch      1.13.0.1-1      @opendistroforelasticsearch-artifacts-repo      189 k
 opendistro-index-management          noarch      1.13.2.0-1      @opendistroforelasticsearch-artifacts-repo      7.8 M
 opendistro-job-scheduler             noarch      1.13.0.0-1      @opendistroforelasticsearch-artifacts-repo      1.0 M
 opendistro-knn                       noarch      1.13.0.0-1      @opendistroforelasticsearch-artifacts-repo      3.0 M
 opendistro-performance-analyzer      noarch      1.13.0.0-1      @opendistroforelasticsearch-artifacts-repo       68 M
 opendistro-reports-scheduler         noarch      1.13.0.0-1      @opendistroforelasticsearch-artifacts-repo      5.8 M
 opendistro-security                  noarch      1.13.1.0-1      @opendistroforelasticsearch-artifacts-repo       42 M
 opendistro-sql                       noarch      1.13.2.0-1      @opendistroforelasticsearch-artifacts-repo       16 M
 opendistroforelasticsearch           x86_64      1.13.2-1        @opendistroforelasticsearch-artifacts-repo      0.0  

Transaction Summary
========================================================================================================================
Remove  1 Package (+11 Dependent packages)

Installed size: 569 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : opendistroforelasticsearch-1.13.2-1.x86_64                                                          1/12 
  Erasing    : opendistro-sql-1.13.2.0-1.noarch                                                                    2/12 
  Erasing    : opendistro-alerting-1.13.1.0-1.noarch                                                               3/12 
  Erasing    : opendistro-job-scheduler-1.13.0.0-1.noarch                                                          4/12 
  Erasing    : opendistro-security-1.13.1.0-1.noarch                                                               5/12 
  Erasing    : opendistro-performance-analyzer-1.13.0.0-1.noarch                                                   6/12 
  Erasing    : opendistro-index-management-1.13.2.0-1.noarch                                                       7/12 
  Erasing    : opendistro-knn-1.13.0.0-1.noarch                                                                    8/12 
  Erasing    : opendistro-anomaly-detection-1.13.0.0-1.noarch                                                      9/12 
  Erasing    : opendistro-reports-scheduler-1.13.0.0-1.noarch                                                     10/12 
  Erasing    : opendistro-asynchronous-search-1.13.0.1-1.noarch                                                   11/12 
Stopping elasticsearch service... OK
  Erasing    : elasticsearch-oss-7.10.2-1.x86_64                                                                  12/12 
warning: /etc/elasticsearch/jvm.options saved as /etc/elasticsearch/jvm.options.rpmsave
warning: /etc/elasticsearch/elasticsearch.yml saved as /etc/elasticsearch/elasticsearch.yml.rpmsave
Deleting log directory... OK
Deleting plugins directory... OK
userdel: user elasticsearch is currently used by process 4617
groupdel: cannot remove the primary group of user 'elasticsearch'
warning: %postun(elasticsearch-oss-0:7.10.2-1.x86_64) scriptlet failed, exit status 8
Non-fatal POSTUN scriptlet failure in rpm package elasticsearch-oss-7.10.2-1.x86_64
  Verifying  : opendistro-index-management-1.13.2.0-1.noarch                                                       1/12 
  Verifying  : opendistro-reports-scheduler-1.13.0.0-1.noarch                                                      2/12 
  Verifying  : opendistro-knn-1.13.0.0-1.noarch                                                                    3/12 
  Verifying  : opendistro-alerting-1.13.1.0-1.noarch                                                               4/12 
  Verifying  : opendistro-performance-analyzer-1.13.0.0-1.noarch                                                   5/12 
  Verifying  : opendistro-sql-1.13.2.0-1.noarch                                                                    6/12 
  Verifying  : elasticsearch-oss-7.10.2-1.x86_64                                                                   7/12 
  Verifying  : opendistroforelasticsearch-1.13.2-1.x86_64                                                          8/12 
  Verifying  : opendistro-asynchronous-search-1.13.0.1-1.noarch                                                    9/12 
  Verifying  : opendistro-security-1.13.1.0-1.noarch                                                              10/12 
  Verifying  : opendistro-anomaly-detection-1.13.0.0-1.noarch                                                     11/12 
  Verifying  : opendistro-job-scheduler-1.13.0.0-1.noarch                                                         12/12 

Removed:
  elasticsearch-oss.x86_64 0:7.10.2-1                                                                                   

Dependency Removed:
  opendistro-alerting.noarch 0:1.13.1.0-1                      opendistro-anomaly-detection.noarch 0:1.13.0.0-1         
  opendistro-asynchronous-search.noarch 0:1.13.0.1-1           opendistro-index-management.noarch 0:1.13.2.0-1          
  opendistro-job-scheduler.noarch 0:1.13.0.0-1                 opendistro-knn.noarch 0:1.13.0.0-1                       
  opendistro-performance-analyzer.noarch 0:1.13.0.0-1          opendistro-reports-scheduler.noarch 0:1.13.0.0-1         
  opendistro-security.noarch 0:1.13.1.0-1                      opendistro-sql.noarch 0:1.13.2.0-1                       
  opendistroforelasticsearch.x86_64 0:1.13.2-1                

Complete!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant