forked from spotify/helios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
helios-master
executable file
·51 lines (44 loc) · 1.43 KB
/
helios-master
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
51
#!/bin/bash -e
for i in "$@"
do
if [[ "$i" == "--help" || "$i" == "-h" ]]
then
as_service=false
fi
done
if [ -z "$as_service" ]
then
: ${JMXPORT=9202}
: ${JDWPPORT=5005}
AGENTLIB=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=$JDWPPORT
fi
args=()
dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ -e "$dir/../helios-services" ]]; then
jar="$(ls -t $dir/../helios-services/target/helios*-shaded.jar | grep -v sources | grep -v javadoc | head -n 1)"
CLASSPATH="$(cd $(dirname $jar) && pwd -P)/$(basename $jar)"
echo "running in helios project, using $CLASSPATH" 1>&2
else
CLASSPATH="/usr/share/helios/lib/services/*"
fi
if [ $JMXPORT ]; then
args=("${args[@]}"
-Dcom.sun.management.jmxremote.port=$JMXPORT
-Dcom.sun.management.jmxremote.rmi.port=$JMXPORT
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false )
fi
# Allow the path to the java installation to be specified in the JAVA environment variable.
# This can be useful if you want to run helios-master using a different version of Java than the
# default version on the host (possibly set up through update-alternatives)
if [ -z $JAVA ]; then
JAVA=java
fi
exec $JAVA \
$HELIOS_MASTER_JVM_OPTS \
"${args[@]}" \
-Djava.net.preferIPv4Stack=true \
-cp "$CLASSPATH" \
$AGENTLIB \
com.spotify.helios.master.MasterMain \
"$@"