-
Notifications
You must be signed in to change notification settings - Fork 24.3k
/
elasticsearch.service
50 lines (39 loc) · 1.97 KB
/
elasticsearch.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
[Unit]
Description=Starts and stops a single elasticsearch instance on this system
Documentation=http://www.elastic.co
Wants=network-online.target
After=network-online.target
[Service]
Environment=ES_HOME=${packaging.elasticsearch.home.dir}
Environment=CONF_DIR=${packaging.elasticsearch.conf.dir}
Environment=CONF_FILE=${packaging.elasticsearch.conf.dir}/elasticsearch.yml
Environment=DATA_DIR=${packaging.elasticsearch.data.dir}
Environment=LOG_DIR=${packaging.elasticsearch.log.dir}
Environment=PID_DIR=${packaging.elasticsearch.pid.dir}
EnvironmentFile=-${packaging.env.file}
User=${packaging.elasticsearch.user}
Group=${packaging.elasticsearch.group}
ExecStart=${packaging.elasticsearch.bin.dir}/elasticsearch \
-Des.pidfile=$PID_DIR/elasticsearch.pid \
-Des.default.path.home=$ES_HOME \
-Des.default.path.logs=$LOG_DIR \
-Des.default.path.data=$DATA_DIR \
-Des.default.config=$CONF_FILE \
-Des.default.path.conf=$CONF_DIR
# Connects standard output to /dev/null
StandardOutput=null
# Connects standard error to journal
StandardError=journal
# When a JVM receives a SIGTERM signal it exits with code 143
SuccessExitStatus=143
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=${packaging.os.max.open.files}
# Specifies the maximum number of bytes of memory that may be locked into RAM
# Set to "infinity" if you use the 'bootstrap.mlockall: true' option
# in elasticsearch.yml and 'MAX_LOCKED_MEMORY=unlimited' in ${packaging.env.file}
#LimitMEMLOCK=infinity
# Shutdown delay in seconds, before process is tried to be killed with KILL (if configured)
TimeoutStopSec=20
[Install]
WantedBy=multi-user.target
# Built for ${project.name}-${project.version} (${packaging.type})