blob: 4814e34bdee54e8b5fe28e66aa7e308b0f7d8831 [file] [log] [blame]
Umesh Krishnaswamyb676ca22013-01-11 12:39:25 -08001#!/bin/sh
2
3# Set paths
4FL_HOME=`dirname $0`
5FL_JAR="${FL_HOME}/target/floodlight.jar"
6FL_LOGBACK="${FL_HOME}/logback.xml"
7
8# Set JVM options
9JVM_OPTS=""
10#JVM_OPTS="$JVM_OPTS -server -d64"
11#JVM_OPTS="$JVM_OPTS -Xmx2g -Xms2g -Xmn800m"
12#JVM_OPTS="$JVM_OPTS -XX:+UseParallelGC -XX:+AggressiveOpts -XX:+UseFastAccessorMethods"
13#JVM_OPTS="$JVM_OPTS -XX:MaxInlineSize=8192 -XX:FreqInlineSize=8192"
14#JVM_OPTS="$JVM_OPTS -XX:CompileThreshold=1500 -XX:PreBlockSpin=8"
15#JVM_OPTS="$JVM_OPTS -Dpython.security.respectJavaAccessibility=false"
16
17# Set classpath to include titan libs
18CLASSPATH=`echo ${FL_HOME}/lib/*.jar ${FL_HOME}/lib/titan/*.jar | sed 's/ /:/g'`
19
20
21# Create a logback file if required
22cat <<EOF_LOGBACK >${FL_LOGBACK}
23<configuration scan="true" debug="true">
24 <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
25 <encoder>
26 <pattern>%level [%logger:%thread] %msg%n</pattern>
27 </encoder>
28 </appender>
29
30 <appender name="FILE" class="ch.qos.logback.core.FileAppender">
31 <file>onos.log</file>
32 <encoder>
33 <pattern>%date %level [%thread] %logger{10} [%file:%line] %msg%n</pattern>
34 </encoder>
35 </appender>
36
37 <logger name="org" level="WARN"/>
38 <logger name="LogService" level="WARN"/> <!-- Restlet access logging -->
39 <logger name="net.floodlightcontroller.logging" level="WARN"/>
40
41 <root level="DEBUG">
42 <appender-ref ref="STDOUT" />
43 <appender-ref ref="FILE" />
44 </root>
45</configuration>
46EOF_LOGBACK
47
48# Delete and recreate /tmp/netmap
49rm -r /tmp/netmap
50mkdir /tmp/netmap
51
52# Run floodlight
53echo "Starting ONOS controller ..."
54echo
55java ${JVM_OPTS} -Dlogback.configurationFile=${FL_LOGBACK} -Xbootclasspath/a:$CLASSPATH -jar ${FL_JAR} -cf ./onos.properties