Improvements for init.d, upstart, and systemd-based systems
1. Change ownership of /onos/apps
onos-service needs write access to onos/apps/foo in order to activate
an app. This also means that ONOS itself could also activate/deactivate,
modify, or reinstall apps, which seems a bit dodgy but is probably
intended.
2. Fix sudo command line
The -b option was in the wrong place, breaking sudo on systems where
we use sudo to start onos (e.g. older debian or centos.)
3. Redirect stderr of 'type daemon' command
We want to detect whether the 'daemon' function/script is available
in init.d enviroments that support it, and we do so using the type
command. Previously we didn't redirect stderr, so this resulted
in a confusing error message being sent to stderr of whoever is
invoking the script.
4. onos.conf has changed to be more consistent with onos.initd
Previously onos.conf ignored $ONOS_GROUP and had a slightly different
structure.
5. onos.service has been added for systemd-based systems
This initial version of onos.service calls /etc/init.d/onos to start
and stop ONOS. In the future we may be able to call onos-service
directly, but we will need to make sure that permissions are set up
correctly so that onos-service can activate apps and so that ONOS
itself can write its log files.
6. A README has been added
7. Update the onos-install and onos-uninstall scripts
Related Jira issue: ONOS-5550
Change-Id: Ie72775f1d0a4082af9c5ea9b13999c427c15ffe0
diff --git a/tools/package/init/README b/tools/package/init/README
new file mode 100644
index 0000000..22a80a8
--- /dev/null
+++ b/tools/package/init/README
@@ -0,0 +1,18 @@
+ONOS "service" configuration files
+
+In order to run ONOS as a "service," whose execution is managed
+by the OS, you can install an appropriate configuration/startup file.
+
+onos.initd: startup file for SysV/init.d-based systems
+ usually installed as /etc/init.d/onos
+
+onos.conf: configuration for upstart-based systems
+ usually installed as /etc/init/onos.conf
+
+onos.service: configuration for systemd-based systems
+ currently calls /etc/init.d/onos start
+ usually installed as /etc/systemd/system/onos.service
+
+The reason why onos.service currently calls /etc/init.d/onos
+is because the init.d script fixes permissions that are required
+by onos-service (such as /opt/onos/apps.)