Skip to content

Commit 913e773

Browse files
author
Dale McDiarmid
authored
Merge pull request elastic#157 from jakommo/master
Updated systemd template with the changes from the one that ships wit…
2 parents e55462b + 34f4c49 commit 913e773

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

templates/systemd/elasticsearch.j2

+8-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@ Environment=LOG_DIR={{log_dir}}
1212
Environment=PID_DIR={{pid_dir}}
1313
EnvironmentFile=-{{instance_default_file}}
1414

15+
WorkingDirectory={{es_home}}
16+
1517
User={{es_user}}
1618
Group={{es_group}}
1719

20+
{% if es_version | version_compare('2.0', '>=') %}
21+
ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec
22+
{% endif %}
23+
1824
ExecStart={{es_home}}/bin/elasticsearch \
1925
-Des.pidfile=${PID_DIR}/elasticsearch.pid \
2026
-Des.default.path.home=${ES_HOME} \
@@ -24,11 +30,8 @@ ExecStart={{es_home}}/bin/elasticsearch \
2430

2531

2632

27-
# Connects standard output to /dev/null
28-
StandardOutput=null
29-
30-
# Connects standard error to journal
31-
StandardError=journal
33+
StandardOutput=journal
34+
StandardError=inherit
3235

3336
# Specifies the maximum file descriptor number that can be opened by this process
3437
LimitNOFILE={{es_max_open_files}}

0 commit comments

Comments
 (0)