blob: 566711494c39a83afda6a0554978bc2f1844f1f4 [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
Jonathan Hart5a023042013-02-05 16:15:49 -080049#rm -rf /tmp/cassandra.titan
50#mkdir /tmp/cassandra.titan
Umesh Krishnaswamy84f0cac2013-01-23 19:07:13 -080051
52# Clear logs
53rm onos.log
Umesh Krishnaswamyb676ca22013-01-11 12:39:25 -080054
55# Run floodlight
56echo "Starting ONOS controller ..."
57echo
Jonathan Hartc0e113a2013-02-05 17:27:21 -080058#java ${JVM_OPTS} -Dlogback.configurationFile=${FL_LOGBACK} -Xbootclasspath/a:$CLASSPATH -jar ${FL_JAR} -cf ./onos.properties
59java ${JVM_OPTS} -Dlogback.configurationFile=${FL_LOGBACK} -jar ${FL_JAR} -cf ./onos.properties