-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
Default user / group not written to /etc/sysconfig/elasticsearch #80
Comments
Hi, This is something i still want to solve indeed. What do you think? |
I know that user / group are defaulted in On a related note, how would you recommend keeping the other information consistent as well (such as paths)? Right now, the RPM by default creates a defaults file with paths that align with the package's install locations and such (MAX_MAP_COUNT, HOME_DIR, CONF_DIR, CONF_FILE, WORK_DIR, LOG_DIR, DATA_DIR), so needing to override a single value with the Puppet module requires you to redefine everything. As much as adding additional dependencies annoys me, perhaps it would be worthwhile to look into using Augeas for defining overrides? It would obviously be possible to keep the packaged defaults in-sync with the Puppet module, but with the ability to install from a specific file, differing defaults across distros, etc. it could be annoying to maintain. Let me know if I'm over-thinking / over-engineering, or if I'm missing something obvious / simple; otherwise, I might spend some time this weekend seeing if it's a valid approach. Thanks for the response! |
Hi, I could set a hash with the current values of the defaults file and write that no matter what. I think the main downside at the moment is that the init scripting fully depends on variable set in the defaults file. Augeas could be a good solution indeed but would like to keep dependencies as minimally as possible. Any idea's? |
Did a bit of digging on the augeas part and it should be doable. |
Hi, Been working on it for a bit and seems to work. |
These are the main changes: 862d677 |
That worked absolutely perfectly, and it was resolved much quicker than I would have been able to knock it out. Much appreciated! As to your previous comments: I absolutely agree that the init script is too dependent on those settings being defined in the sysconfig file. However, these changes at least provide a way for the user to only need to override specific settings, and leave the underlying framework in place. If the initscript does become more intelligent in the future, this patch will still continue to function as desired. Again, thanks for the quick response! I'll leave the closing of the issue to you, to allow closing it with the master merge. |
Just need to fix the $elasticsearch_user and $elasticsearch_group options so they do get into the defaults file.. otherwise its still useless. ( just a bit less useless with this rewrite of it ) |
Found a solution for the last bit. Can you check after I've pushed it? |
Should be fixed now. Can you check it? Cheers. |
Pushed an other fix so it works with older versions ( pre 1.0 ) of augeas. |
I'll check it out this morning. Thanks for the quick turnaround! |
No problem :-) |
Talked via other channels. issue solved. |
Currently, it appears that
/etc/sysconfig/elasticsearch
is only written out with the values passed in forinit_defaults
, meaning that user and group are not defined if not provided explicitly (such as when using the defaults). This seems to cause the initscript to fail starting the service, as$ES_USER
is not defined prior to the call todaemon
.This causes the following message when attempting to start the service via the initscript:
This is triggered by templates/etc/init.d/elasticsearch.RedHat.erb, line 85.
I can work around it for now by handing
ES_USER
ininit_defaults
, but it seems like it's necessary to make sure that it is set properly in advance of launching the daemon in the initscript.The text was updated successfully, but these errors were encountered: