-
-
Notifications
You must be signed in to change notification settings - Fork 606
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
Use start-stop-daemon to start when on debian family so we can background correctly #91
Use start-stop-daemon to start when on debian family so we can background correctly #91
Conversation
Chris, any idea why this is happening? Should we use similar platform specific solutions on RHEL etc? Can you check and compare the .deb and .rpm packages done by Elasticsearch? |
I've solved this in a slightly different way locally - I have just added the 'start' action to the elasticsearch service so chef continues to ensure that the service is started. I'm not sure why this cookbook only declares the service with the 'enable' action and only notifies a 'start' when ES is first installed with the ark resource, but I guess there's some historical reason. |
@Pneumatus My wrapper cookbook is providing the @karmi It looks like it has to do with the behavior of the spawned es process and it not properly detaching from the parent process, so it dies when the parent process dies. This is why the |
I am investigating a similar issue here which I think has the same underlying cause. In my case we are starting elasticsearch from chef. The chef-client was started via upstart (on Ubuntu 12.04). Our problem is that when we stop the chef-client then elasticsearch is killed too. The reason upstarted kills elasticsearch as well is that it belongs to the same process group as chef-client. That is the startup script does not properly daemonize the elasticsearch process. The missing step is changing the process group. The easiest way to change this is to add a 'setsid' before the su command which starts elasticsearch in the init-file. I guess that start-sto-daemon with --background does something similar. |
@chrisroberts @Pneumatus @maf23 Hi, thanks for all the info! It seems like using the I'll try to verify this and include it as soon as possible. |
👍 |
Any chance this is going to make it's way in soon? We are having to start elastic search manually on Ubuntu 12.04 when we converge a fresh node. I'd like to avoid having to fork this cookbook to implements @chrisroberts fix. |
@chrisroberts Got to the issue at last, sorry Chris! I'm wondering if platform-specific templates would be a good idea, as per #98. Note that I wrote the original init script without any thorough testing across Linux variants. I'd like to somehow facilitate using a custom init script, a la https://gist.github.com/fujin/1713157, maybe it's just a matter of proper documentation. |
Initial bootstraps would start the service, but would not leave the service running (service would die after provision completed and ssh connection severed). Updates to use start-stop-daemon to start on debian platform families. Uses the
--background
option to force the process to properly detach. (may be loosely related to #32)