Adding init script for the warden.
Change-Id: I2789f802aaf1a2b79162a888994bb941d0d5c1b9
Showing
4 changed files
with
83 additions
and
23 deletions
tools/test/cells/101
deleted
100644 → 0
| 1 | -# Developer cell | ||
| 2 | - | ||
| 3 | -export ONOS_NIC="10.128.11.*" | ||
| 4 | -export OCN="10.128.11.100" | ||
| 5 | -export OCT="10.128.11.101" | ||
| 6 | - | ||
| 7 | -export OC1="10.128.11.101" | ||
| 8 | -export OC2="10.128.11.102" | ||
| 9 | -export OC3="10.128.11.103" | ||
| 10 | -export ONOS_USE_SSH=true | ||
| 11 | -export ONOS_APPS=drivers,openflow,proxyarp,mobility,pathpainter |
tools/test/cells/102
deleted
100644 → 0
| 1 | -# Developer cell | ||
| 2 | - | ||
| 3 | -export ONOS_NIC="10.128.11.*" | ||
| 4 | -export OCN="10.128.11.200" | ||
| 5 | -export OCT="10.128.11.201" | ||
| 6 | - | ||
| 7 | -export OC1="10.128.11.201" | ||
| 8 | -export OC2="10.128.11.202" | ||
| 9 | -export OC3="10.128.11.203" | ||
| 10 | -export ONOS_USE_SSH=true | ||
| 11 | -export ONOS_APPS=drivers,openflow,proxyarp,mobility,pathpainter |
| ... | @@ -71,7 +71,7 @@ class Warden { | ... | @@ -71,7 +71,7 @@ class Warden { |
| 71 | */ | 71 | */ |
| 72 | Warden() { | 72 | Warden() { |
| 73 | random.setSeed(System.currentTimeMillis()); | 73 | random.setSeed(System.currentTimeMillis()); |
| 74 | - timer.schedule(new Reposessor(), MINUTE / 4, MINUTE); | 74 | + timer.schedule(new Reposessor(), MINUTE / 4, MINUTE / 2); |
| 75 | } | 75 | } |
| 76 | 76 | ||
| 77 | /** | 77 | /** | ... | ... |
utils/warden/warden.initd
0 → 100755
| 1 | +#! /bin/bash | ||
| 2 | +# ----------------------------------------------------------------------------- | ||
| 3 | +# init.d script to run ON.Lab test cell warden | ||
| 4 | +## ----------------------------------------------------------------------------- | ||
| 5 | +### BEGIN INIT INFO | ||
| 6 | +# Provides: warden | ||
| 7 | +# Required-Start: $network $remote_fs $syslog | ||
| 8 | +# Required-Stop: $network $remote_fs $syslog | ||
| 9 | +# Default-Start: 2 3 4 5 | ||
| 10 | +# Default-Stop: 0 1 6 | ||
| 11 | +# Short-Description: ON.Lab Test Cell Warden | ||
| 12 | +# Description: Warden is a broker for sharing test cell infrastructure among ON.Lab developers. | ||
| 13 | +### END INIT INFO | ||
| 14 | + | ||
| 15 | +WARDEN_USER="sdn" | ||
| 16 | +WARDEN_HOME="/home/$WARDEN_USER/warden" | ||
| 17 | +WARDEN_VERSION="1.6.0-SNAPSHOT" | ||
| 18 | +DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005" | ||
| 19 | + | ||
| 20 | +cd $WARDEN_HOME | ||
| 21 | + | ||
| 22 | +start () { | ||
| 23 | + # Start warden if it's not already running | ||
| 24 | + if ! status >/dev/null; then | ||
| 25 | + echo "Starting Warden" | ||
| 26 | + startwarden | ||
| 27 | + else | ||
| 28 | + echo "Warden is already running" | ||
| 29 | + fi | ||
| 30 | +} | ||
| 31 | + | ||
| 32 | +startwarden () { | ||
| 33 | + start-stop-daemon --signal INT --start --chuid $WARDEN_USER \ | ||
| 34 | + --pidfile $WARDEN_HOME/warden.pid --make-pidfile \ | ||
| 35 | + --background --chdir $WARDEN_HOME \ | ||
| 36 | + --exec /usr/bin/java -- -jar onlab-warden-$WARDEN_VERSION.jar \ | ||
| 37 | + &>$WARDEN_HOME/std.log | ||
| 38 | +} | ||
| 39 | + | ||
| 40 | +stop () { | ||
| 41 | + if status >/dev/null; then | ||
| 42 | + echo "Stopping Warden" | ||
| 43 | + start-stop-daemon --signal INT --stop --chuid $WARDEN_USER \ | ||
| 44 | + --pidfile $WARDEN_HOME/warden.pid | ||
| 45 | + rm warden.pid | ||
| 46 | + else | ||
| 47 | + echo "Warden is not running" | ||
| 48 | + fi | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +restart () { | ||
| 52 | + stop | ||
| 53 | + start | ||
| 54 | +} | ||
| 55 | + | ||
| 56 | +status () { | ||
| 57 | + start-stop-daemon --signal INT --status --chuid $WARDEN_USER \ | ||
| 58 | + --pidfile $WARDEN_HOME/warden.pid | ||
| 59 | +} | ||
| 60 | + | ||
| 61 | +case $1 in | ||
| 62 | + start) | ||
| 63 | + start | ||
| 64 | + ;; | ||
| 65 | + stop | force-stop) | ||
| 66 | + stop | ||
| 67 | + ;; | ||
| 68 | + restart) | ||
| 69 | + shift | ||
| 70 | + restart "$@" | ||
| 71 | + ;; | ||
| 72 | + status) | ||
| 73 | + status && echo "Warden is running" || echo "Warden is stopped" | ||
| 74 | + exit $? | ||
| 75 | + ;; | ||
| 76 | + *) | ||
| 77 | + echo "Usage: $0 {start|stop|restart|status}" >&2 | ||
| 78 | + exit 1 | ||
| 79 | + ;; | ||
| 80 | +esac | ||
| 81 | + | ||
| 82 | +exit 0 |
-
Please register or login to post a comment