forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogstash.upstart.ubuntu
47 lines (37 loc) · 1.12 KB
/
logstash.upstart.ubuntu
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
# logstash - agent instance
#
description "logstash agent"
start on virtual-filesystems
stop on runlevel [06]
# Respawn it if the process exits
respawn
# We're setting high here, we'll re-limit below.
limit nofile 65550 65550
setuid logstash
setgid logstash
# You need to chdir somewhere writable because logstash needs to unpack a few
# temporary files on startup.
console log
script
# Defaults
PATH=/bin:/usr/bin
LS_HOME=/var/lib/logstash
LS_HEAP_SIZE="500m"
LS_LOG_FILE=/var/log/logstash/logstash.log
LS_USE_GC_LOGGING=""
LS_CONF_DIR=/etc/logstash/conf.d
LS_OPEN_FILES=16384
LS_NICE=19
LS_OPTS=""
# Override our defaults with user defaults:
[ -f /etc/default/logstash ] && . /etc/default/logstash
HOME="${HOME:-$LS_HOME}"
LS_JAVA_OPTS="${LS_JAVA_OPTS} -Djava.io.tmpdir=${LS_HOME}"
# Reset filehandle limit
ulimit -n ${LS_OPEN_FILES}
cd "${LS_HOME}"
# Export variables
export PATH HOME LS_HEAP_SIZE LS_JAVA_OPTS LS_USE_GC_LOGGING
test -n "${JAVACMD}" && export JAVACMD
exec nice -n ${LS_NICE} /opt/logstash/bin/logstash agent -f "${LS_CONF_DIR}" -l "${LS_LOG_FILE}" ${LS_OPTS}
end script