Separate options for disabling upstart/init.d installation
I'm not too happy with negative options, but the advantage is
that the basic onos-install should "just work."
Change-Id: Ie57142feea23e1ed7b5757098772a60de13c3e37
diff --git a/tools/test/bin/onos-install b/tools/test/bin/onos-install
index ff4fb44..ff52c72 100755
--- a/tools/test/bin/onos-install
+++ b/tools/test/bin/onos-install
@@ -10,7 +10,9 @@
flags:
- -f : forces uninstall of currently installed ONOS
-- -n : do not copy over onos.conf upstart configuration file.
+- -u : don't install onos.conf upstart configuration file
+- -i : don't install /etc/init.d/onos script (also used by onos.conf)
+- -n : don't try to start ONOS
- -m <settings> : pass <settings> XML file to remote maven installation
options:
@@ -19,8 +21,7 @@
summary:
Remotely pushes bits to a remote node and installs ONOS on it.
- The [-n] flag assumes that Upstart is used. The [-f] flag depends on
- and 'onos-config'.
+ The -u should be used on upstart-based systems.
If [node] is not specified the default target is \$OCI.
@@ -35,6 +36,8 @@
while getopts fnm: o; do
case "$o" in
f) uninstall=true;;
+ u) noupstart=true; noinitd=true;;
+ i) noinitd=true;;
n) nostart=true;;
m) mvn_settings=$OPTARG;;
esac
@@ -69,21 +72,21 @@
# TODO: use $KARAF_DATA
mkdir -p -- $ONOS_INSTALL_DIR/$KARAF_DIST/data/raft
- # Install the upstart configuration file and setup options for debugging
- [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/init/onos.conf /etc/init/onos.conf
- [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/init/onos.initd /etc/init.d/onos
+ # Install the configuration file(s) and set up options for debugging
+ [ -n $noupstart ] && sudo cp $ONOS_INSTALL_DIR/init/onos.conf /etc/init/onos.conf
+ [ -n $noinitd ] && sudo cp $ONOS_INSTALL_DIR/init/onos.initd /etc/init.d/onos
echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options
- # Setup correct user to run onos-service
- echo 'export ONOS_USER="${ONOS_USER:-sdn}"' >> $ONOS_INSTALL_DIR/options
+ # Set up correct user to run onos-service
+ echo 'export ONOS_USER=$ONOS_USER' >> $ONOS_INSTALL_DIR/options
# Remove any previous ON.Lab bits from ~/.m2 repo.
rm -fr ~/.m2/repository/org/onosproject
- [ ! -z "$mvn_settings" ] && cp /tmp/settings.xml ~/.m2/settings.xml
+ [ ! -z $mvn_settings ] && cp /tmp/settings.xml ~/.m2/settings.xml
# Drop log level for the console
- echo "log4j.logger.org.apache.sshd = WARN" \
+ echo 'log4j.logger.org.apache.sshd = WARN' \
>> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg
"