aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/tools/package/init/onos.conf
diff options
context:
space:
mode:
authorAshlee Young <ashlee@onosfw.com>2015-09-22 12:49:09 -0700
committerAshlee Young <ashlee@onosfw.com>2015-09-22 12:49:09 -0700
commit81391595dca425ae58e2294898f09f11d9a32dbc (patch)
treef5d65c39a732150b2b29daa8de98a35d1236d3fb /framework/src/onos/tools/package/init/onos.conf
parent0aa37e73dcb3a55b8d889b0c32ff74055551b1f3 (diff)
bringing src to commit tag 65d551b50e782b0c1ea76c1a9ed1c5a801a5a7e4
Change-Id: Ib2da78962eaef856f418636c31b0f5c84286244f
Diffstat (limited to 'framework/src/onos/tools/package/init/onos.conf')
-rw-r--r--framework/src/onos/tools/package/init/onos.conf37
1 files changed, 37 insertions, 0 deletions
diff --git a/framework/src/onos/tools/package/init/onos.conf b/framework/src/onos/tools/package/init/onos.conf
new file mode 100644
index 00000000..779df905
--- /dev/null
+++ b/framework/src/onos/tools/package/init/onos.conf
@@ -0,0 +1,37 @@
+description "Open Network Operating System"
+author "ON.Lab"
+
+start on (net-device-up
+ and local-filesystems
+ and runlevel [2345])
+stop on runlevel [016]
+
+console output
+kill timeout 60
+respawn
+
+env LANG=en_US.UTF-8
+
+pre-start script
+ [ -f /opt/onos/options ] && . /opt/onos/options
+ ONOS_USER=${ONOS_USER:-root}
+
+ # Ensure that the environment is initialized
+ [ -d /opt/onos ] && mkdir /opt/onos/var 2>/dev/null && chown $ONOS_USER.$ONOS_USER /opt/onos/var
+ [ -d /opt/onos ] && mkdir /opt/onos/config 2>/dev/null && chown $ONOS_USER.$ONOS_USER /opt/onos/config
+ # TODO make karaf version configurable
+ [ -d /opt/onos ] && [ ! -h /opt/onos/log ] \
+ && ln -s /opt/onos/apache-karaf-3.0.3/data/log /opt/onos/log || :
+end script
+
+pre-stop script
+ /opt/onos/bin/onos halt 2>>/opt/onos/var/stderr.log
+ sleep 1
+end script
+
+script
+ [ -f /opt/onos/options ] && . /opt/onos/options
+ start-stop-daemon --signal INT --start --chuid ${ONOS_USER:-root} \
+ --exec /opt/onos/bin/onos-service -- ${ONOS_OPTS:-server} \
+ >/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log
+end script