mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
48 lines
1.1 KiB
Text
48 lines
1.1 KiB
Text
# 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="1g"
|
|
LS_LOG_FILE=/var/log/logstash/logstash.log
|
|
LS_USE_GC_LOGGING=""
|
|
LS_GC_LOG_FILE=""
|
|
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 LS_GC_LOG_FILE
|
|
test -n "${JAVACMD}" && export JAVACMD
|
|
|
|
exec nice -n ${LS_NICE} /opt/logstash/bin/logstash -f "${LS_CONF_DIR}" -l "${LS_LOG_FILE}" ${LS_OPTS}
|
|
end script
|