Sometimes it’s useful to run ONOS as a service, particularly in production environments. This is where things get more complicated and specialized, depending on the operating system you’re running. This section describes how to configure ONOS to run as a service on typical Linux distributions.
When ONOS runs as a service, the OS will start it automatically as part of the boot process. On
upstart-based systems, it should also automatically be restarted if it crashes. Once the service configuration files have been installed, you can typically start, stop, and check the status of ONOS using the
Please not that this guide has different commands for different systems (i.e. Ubuntu, Debian, etc.) ensure you are running the correct command for your version, have fun.
Install the service files
Note that on other, older, systems that use the
/etc/init.d/ scripts but do not included the
update-rc.d command you may need to manually create symbolic links in the appropriate
rcX.d/ directories as desired, if you wish ONOS to start automatically.
Configure ONOS Options
The ONOS services read configuration options from
/opt/onos/options. If you have created an ONOS user (e.g.
sdn), you should set
/opt/onos/options to the user you wish ONOS to run as.
You can also specify
ONOS_APPS as a default set of applications to activate.
ONOS_APPS is an optional way of specifying default apps to activate on a node, but you can also activate apps dynamically across the entire ONOS cluster using the ONOS CLI, as described in Managing ONOS applications.