Thomas Vachuska | 9edca30 | 2014-11-22 17:06:42 -0800 | [diff] [blame] | 1 | description "Open Network Operating System" |
tom | 0eaa97f | 2014-09-22 16:13:06 -0700 | [diff] [blame] | 2 | author "ON.Lab" |
| 3 | |
| 4 | start on (net-device-up |
| 5 | and local-filesystems |
| 6 | and runlevel [2345]) |
| 7 | stop on runlevel [016] |
| 8 | |
| 9 | console output |
| 10 | kill timeout 60 |
| 11 | respawn |
| 12 | |
| 13 | env LANG=en_US.UTF-8 |
Brian O'Connor | 5468fa4 | 2015-09-16 17:41:25 -0700 | [diff] [blame^] | 14 | |
| 15 | pre-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 || : |
| 22 | end script |
tom | 0eaa97f | 2014-09-22 16:13:06 -0700 | [diff] [blame] | 23 | |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 24 | pre-stop script |
Thomas Vachuska | 74bcd92 | 2015-06-02 13:08:57 -0700 | [diff] [blame] | 25 | /opt/onos/bin/onos halt 2>>/opt/onos/var/stderr.log |
| 26 | sleep 1 |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 27 | end script |
| 28 | |
tom | 0eaa97f | 2014-09-22 16:13:06 -0700 | [diff] [blame] | 29 | script |
| 30 | [ -f /opt/onos/options ] && . /opt/onos/options |
Brian O'Connor | 5468fa4 | 2015-09-16 17:41:25 -0700 | [diff] [blame^] | 31 | start-stop-daemon --signal INT --start --chuid ${ONOS_USER:-root} \ |
| 32 | --exec /opt/onos/bin/onos-service -- ${ONOS_OPTS:-server} \ |
tom | 0eaa97f | 2014-09-22 16:13:06 -0700 | [diff] [blame] | 33 | >/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log |
| 34 | end script |