From 74f3941756a1386cbc1fa99ee73fdc8376a0b6a0 Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 9 Oct 2015 18:38:53 -0700 Subject: added missing directory structure for rpmbuild Change-Id: I42b06b4318868e08e85a90e81f06357dbda75bef --- framework/src/onos/etc/init/onos.conf | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 framework/src/onos/etc/init/onos.conf (limited to 'framework/src/onos/etc/init') diff --git a/framework/src/onos/etc/init/onos.conf b/framework/src/onos/etc/init/onos.conf new file mode 100644 index 00000000..779df905 --- /dev/null +++ b/framework/src/onos/etc/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 -- cgit 1.2.3-korg