Sometimes it’s useful to run ONOS as a service, specially in production environments. This is where things get more articulated and different, depending on the operating system you’re running.
Running ONOS as a service from a target machine
Install the service files
sudo cp /opt/onos/init/onos.initd /etc/init.d/onos
sudo update-rc.d onos defaults
sudo cp /opt/onos/init/onos.conf /etc/init/onos.conf
sudo cp /opt/onos/init/onos.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable onos
Configure ONOS Options
The ONOS services read configuration options from /opt/onos/config
. If you have created an ONOS user (e.g. sdn
), you should set ONOS_USER
in /opt/onos/config
to the user you wish ONOS to run as
You can also specify ONOS_APPS
as a default set of applications to activate.
Here is a sample /opt/onos/config
file:
ONOS_USER=sdn # Optional: add any apps here that you wish to activate by default ONOS_APPS=
Note that 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.
Start, stop check the status of the ONOS service
sudo service onos {start|stop|status}