blob: f415f8e5bb0108b0c2dfa97aa65582fb38f43c99 [file] [log] [blame]
Thomas Vachuska9edca302014-11-22 17:06:42 -08001description "Open Network Operating System"
tom0eaa97f2014-09-22 16:13:06 -07002author "ON.Lab"
3
4start on (net-device-up
5 and local-filesystems
6 and runlevel [2345])
7stop on runlevel [016]
8
9console output
10kill timeout 60
11respawn
12
13env LANG=en_US.UTF-8
Brian O'Connor5468fa42015-09-16 17:41:25 -070014
15pre-start script
16 # Ensure that the environment is initialized
17 [ -d /opt/onos ] && mkdir -p /opt/onos/var
18 [ -d /opt/onos ] && mkdir -p /opt/onos/config
19 # TODO make karaf version configurable
20 [ -d /opt/onos ] && [ ! -h /opt/onos/log ] \
21 && ln -s /opt/onos/apache-karaf-3.0.3/data/log /opt/onos/log || :
22end script
tom0eaa97f2014-09-22 16:13:06 -070023
tomb41d1ac2014-09-24 01:51:24 -070024pre-stop script
Thomas Vachuska74bcd922015-06-02 13:08:57 -070025 /opt/onos/bin/onos halt 2>>/opt/onos/var/stderr.log
26 sleep 1
tomb41d1ac2014-09-24 01:51:24 -070027end script
28
tom0eaa97f2014-09-22 16:13:06 -070029script
30 [ -f /opt/onos/options ] && . /opt/onos/options
Brian O'Connor5468fa42015-09-16 17:41:25 -070031 start-stop-daemon --signal INT --start --chuid ${ONOS_USER:-root} \
32 --exec /opt/onos/bin/onos-service -- ${ONOS_OPTS:-server} \
tom0eaa97f2014-09-22 16:13:06 -070033 >/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log
34end script