aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/odl_cluster/templates/opendaylight.conf
blob: 105bb265137c3f848014172807dc46da3e690037 (plain)
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
# vim:set ft=upstart ts=2 et:
description "OpenDaylight controller"
author "mskalski@miranits.com"

start on runlevel [2345]
stop on runlevel [!2345]

#setgid odl
#setuid odl

env KARAF_HOME="/opt/opendaylight-0.3.0"
#env JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64"
env JAVA_HOME="/usr/lib/jvm/java-8-oracle"
env JAVA_OPTS="-server -Xms128M -Xmx4096M -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:MaxPermSize=512M -Dcom.sun.management.jmxremote"
env OPTS="-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true"
env MAIN="org.apache.karaf.main.Main"


chdir /opt/opendaylight-0.3.0

script
  export KARAF_BASE="$KARAF_HOME"
  export KARAF_DATA="$KARAF_BASE/data"
  export KARAF_ETC="$KARAF_BASE/etc"
  export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:$KARAF_BASE/lib"
  export JAVA_ENDORSED_DIRS="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed"
  export JAVA_EXT_DIRS="${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext"
  export JAVA_SECURITY_PRO="${KARAF_HOME}/etc/odl.java.security"

    for file in "$KARAF_HOME"/lib/karaf*.jar
    do
        if [ -z "$CLASSPATH" ]; then
            CLASSPATH="$file"
        else
            CLASSPATH="$CLASSPATH:$file"
        fi
    done

    exec $JAVA_HOME/bin/java -Djava.security.properties="${JAVA_SECURITY_PRO}" $JAVA_OPTS -Djava.endorsed.dirs="${JAVA_ENDORSED_DIRS}" -Djava.ext.dirs="${JAVA_EXT_DIRS}" -Dkaraf.instances="${KARAF_HOME}/instances" -Dkaraf.home="$KARAF_HOME" -Dkaraf.base="$KARAF_BASE" -Dkaraf.data="$KARAF_DATA" -Dkaraf.etc="$KARAF_ETC" -Djava.io.tmpdir="$KARAF_DATA/tmp" -Djava.util.logging.config.file="$KARAF_BASE/etc/java.util.logging.properties" $KARAF_OPTS $OPTS -classpath "$CLASSPATH" $MAIN

end script