0

We are developing a java (spring boot) based software which depends on Elasticsearch. Right now we integrate elasticsearch via maven (as artifact).

This version seems to be the same as the .zip / .tar.gz version from the elasticsearch website.

As I have noticed there is a service installer for windows (x86 as well as x64).

But it seems that there is no "service installer" for linux in this package. I can use "./bin/elasticsearch -d -p pid" and the corresponding "kill cat pid" command to start/stop elasticsearch but it would be nice to have some form of service installer in this package as well so that elasticsearch is started automatically after an OS reboot.

I know the necessary files for systemd and init.d systems exist (at least in the .deb and .rpm package versions) so I assume it is not such a big deal to have a service installer in the artifact/zip/tar.gz version as well.

Am I right or do I underestimate this issue?

hlpinform
  • 111
  • 8

1 Answers1

0

If there are the init.d files already, all you need to do is create the shortcut in rc.3 or rc.5 folders. Using redhat distros you'd simply do:

$ sudo chkconfig elasticdaemonname on

But that's assuming it is a daemon. If not, you'll have to daemonize it yourself. There are various possibilities to do this and I'm ready to bet all of them are documented for elasticsearch. But you could look for daemonize for start.

Sebas
  • 21,192
  • 9
  • 55
  • 109
  • That is not exactly the point. It seems that there is no built in init/system.d config in the artifact/zip/tar.gz package. Sure, I can add the needed files and scripts by myself. But I hoped that there might be a way to avoid that. – hlpinform Apr 11 '17 at 07:22
  • Make your own, it's very easy. See Daemonize – Sebas Apr 11 '17 at 07:44