forked from elastic/logstash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogstash
executable file
·49 lines (46 loc) · 1.67 KB
/
logstash
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
#!/bin/sh
# Run logstash from source
#
# This is most useful when done from a git checkout.
#
# Usage:
# bin/logstash <command> [arguments]
#
# See 'bin/logstash help' for a list of commands.
#
# Supported environment variables:
# LS_HEAP_SIZE="xxx" size for the -Xmx${LS_HEAP_SIZE} maximum Java heap size option, default is "1g"
# LS_JAVA_OPTS="xxx" to append extra options to the defaults JAVA_OPTS provided by logstash
# JAVA_OPTS="xxx" to *completely override* the defauls set of JAVA_OPTS provided by logstash
#
# Development environment variables:
# USE_RUBY=1 to force use the local "ruby" command to launch logstash instead of using the vendored JRuby
# USE_DRIP=1 to force use drip
# DEBUG=1 to output debugging information
unset CDPATH
# This unwieldy bit of scripting is to try to catch instances where Logstash
# was launched from a symlink, rather than a full path to the Logstash binary
if [ -L $0 ]; then
# Launched from a symlink
# --Test for the readlink binary
RL=$(which readlink)
if [ $? -eq 0 ]; then
# readlink exists
SOURCEPATH=$($RL $0)
else
# readlink not found, attempt to parse the output of stat
SOURCEPATH=$(stat -c %N $0 | awk '{print $3}' | sed -e 's/\‘//' -e 's/\’//')
if [ $? -ne 0 ]; then
# Failed to execute or parse stat
echo "Failed to find source library at path $(cd `dirname $0`/..; pwd)/bin/logstash.lib.sh"
echo "You may need to launch Logstash with a full path instead of a symlink."
exit 1
fi
fi
else
# Not a symlink
SOURCEPATH=$0
fi
. "$(cd `dirname $SOURCEPATH`/..; pwd)/bin/logstash.lib.sh"
setup
ruby_exec "${LOGSTASH_HOME}/lib/bootstrap/environment.rb" "logstash/runner.rb" "$@"