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

can not run elasticsearch as root #68

Closed
oferabr opened this issue Aug 19, 2018 · 3 comments
Closed

can not run elasticsearch as root #68

oferabr opened this issue Aug 19, 2018 · 3 comments

Comments

@oferabr
Copy link

oferabr commented Aug 19, 2018

Hi,

I wrote some tests using the plugin, all works as expected.
when running our project on our jenkins we get "can not run elasticsearch as root".

I know that ES cannot run as root user, is there any option in the plugin settings to run it as different user? or any other solution?

Thanks

@alexcojocaru
Copy link
Owner

I did some basic research into how to run a process as a different user and haven't found anything that's not a hack or a convoluted workaround.
IF it could be done and I implement support for this, off the top I foresee some complications:

  • before starting the ES process, the plugin should change the owner of the ES directory to the other user
  • after terminating the ES process, it should change the owner back to the original user; there could be cases (eg. the plugin crashes, ES crashes, etc) when changing the owner back is not done, leaving the ES directory owned by the other user, and mvn clean would error out because of that
    In summary, the implementation would be very prone to issues and I would rather not go forward with it.

Now, going back to the reason of your ask: I strongly suggest you look into your Jenkins configuration and have the Jenkins process execute as a regular user. The rule of thumb is that the root user should be used sparingly.

@oferabr
Copy link
Author

oferabr commented Aug 20, 2018

Thank you 👍

@alexcojocaru
Copy link
Owner

@oferabr #72 is a duplicate of this. I am considering implementing support for it and I would appreciate your input on it.

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

No branches or pull requests

2 participants