Skip to content

elasticsearch service: remove postStart script #25701

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

Merged

Conversation

fadenb
Copy link
Contributor

@fadenb fadenb commented May 11, 2017

Motivation for this change

fixes #20560 by removing postStart.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@mention-bot
Copy link

@fadenb, thanks for your PR! By analyzing the history of the files in this pull request, we identified @offlinehacker, @bjornfor and @rickynils to be potential reviewers.

@grahamc
Copy link
Member

grahamc commented May 11, 2017

This is pretty tricky, I think our tests expect the port to be up when the unit is Started. No?

@Mic92
Copy link
Member

Mic92 commented May 11, 2017

There is no test for elasticsearch but for logstash.

@fadenb
Copy link
Contributor Author

fadenb commented May 11, 2017

Just ran the logstash test. It loops until it gets the expected result.

one# [    4.978303] systemd[1]: Started Name Service Cache Daemon.
one# [    4.989546] nscd[843]: 843 monitoring directory `/etc` (2)
one# [    4.991902] systemd[1]: Startup finished in 2.499s (kernel) + 2.460s (userspace) = 4.959s.
one# [    4.997228] nscd[843]: 843 monitoring file `/etc/hosts` (4)
one# [    4.998320] nscd[843]: 843 monitoring directory `/etc` (2)
one# [    5.003438] nscd[843]: 843 monitoring file `/etc/resolv.conf` (5)
one# [    5.005775] nscd[843]: 843 monitoring directory `/etc` (2)
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one# [    5.728642] dhcpcd[839]: eth0: Router Advertisement from fe80::2
one# [    5.731380] dhcpcd[839]: eth0: adding address fec0::5054:ff:fe12:3456/64
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one# [   26.306764] logstash[535]: {:timestamp=>"2017-05-11T12:40:57.406000+0000", :message=>"Pipeline main started"}
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 1
one# [   26.991390] logstash[535]: Could not load : can't convert nil into String
one# [   26.999073] logstash[535]: {
one# [   26.999841] logstash[535]:        "message" => "flowers\n",
one# [   27.000762] logstash[535]:       "@version" => "1",
one# [   27.001582] logstash[535]:     "@timestamp" => "2017-05-11T12:40:57.236Z",
one# [   27.003423] logstash[535]:           "type" => "test",
one# [   27.005248] logstash[535]:           "host" => "one",
one# [   27.007100] logstash[535]:        "command" => "echo flowers"
one# [   27.007985] logstash[535]: }
one# [   27.749304] logstash[535]: Could not load : can't convert nil into String
one# [   27.759496] logstash[535]: {
one# [   27.760202] logstash[535]:        "message" => "flowers\n",
one# [   27.760862] logstash[535]:       "@version" => "1",
one# [   27.761511] logstash[535]:     "@timestamp" => "2017-05-11T12:40:58.185Z",
one# [   27.762240] logstash[535]:           "type" => "test",
one# [   27.762841] logstash[535]:           "host" => "one",
one# [   27.764547] logstash[535]:        "command" => "echo flowers"
one# [   27.766296] logstash[535]: }
one: running command: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep flowers
one: exit status 0
one: must fail: journalctl -n 20 _SYSTEMD_UNIT=logstash.service | grep dragons
one: exit status 1
collecting coverage data
one: running command: test -e /sys/kernel/debug/gcov
one: exit status 1
syncing
one: running command: sync
one: exit status 0
test script finished in 28.90s
cleaning up
killing one (pid 28073)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/tmp/nix-build-vm-test-run-logstash.drv-0/vde1.ctl': Directory not empty
/nix/store/57yl01ax9wl6g9j2vp0p8xbznv0p6bqs-vm-test-run-logstash

@offlinehacker
Copy link
Contributor

Is there any better way to check if elasticsearch is listening?

@offlinehacker
Copy link
Contributor

And I agree with pull request, I think it's ok to merge this, except if someone comes up some simple alternative solution.

@joachifm joachifm merged commit 76430ec into NixOS:master Jun 12, 2017
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

Successfully merging this pull request may close these issues.

services.elasticsearch.listenAddress does not work with special values like '_eth0_'
6 participants