onos.conf
942 Bytes
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
# Ensure that the environment is initialized
[ -d /opt/onos ] && mkdir -p /opt/onos/var
[ -d /opt/onos ] && mkdir -p /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