From a9f01fed17974af0e1999447164936f1977ff14a Mon Sep 17 00:00:00 2001 From: Jakob Reiter Date: Mon, 19 Sep 2016 17:45:12 +0200 Subject: [PATCH] Updated systemd template with the changes from the one that ships with the .deb/.rpm. Closes #149 --- templates/systemd/elasticsearch.j2 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/templates/systemd/elasticsearch.j2 b/templates/systemd/elasticsearch.j2 index ab75b44..714646f 100644 --- a/templates/systemd/elasticsearch.j2 +++ b/templates/systemd/elasticsearch.j2 @@ -12,9 +12,13 @@ Environment=LOG_DIR={{log_dir}} Environment=PID_DIR={{pid_dir}} EnvironmentFile=-{{instance_default_file}} +WorkingDirectory={{es_home}} + User={{es_user}} Group={{es_group}} +ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec + ExecStart={{es_home}}/bin/elasticsearch \ -Des.pidfile=${PID_DIR}/elasticsearch.pid \ -Des.default.path.home=${ES_HOME} \ @@ -24,11 +28,8 @@ ExecStart={{es_home}}/bin/elasticsearch \ -# Connects standard output to /dev/null -StandardOutput=null - -# Connects standard error to journal -StandardError=journal +StandardOutput=journal +StandardError=inherit # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE={{es_max_open_files}}