Committed by
Gerrit Code Review
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
Showing
1 changed file
with
13 additions
and
10 deletions
... | @@ -10,7 +10,9 @@ usage: | ... | @@ -10,7 +10,9 @@ usage: |
10 | 10 | ||
11 | flags: | 11 | flags: |
12 | - -f : forces uninstall of currently installed ONOS | 12 | - -f : forces uninstall of currently installed ONOS |
13 | -- -n : do not copy over onos.conf upstart configuration file. | 13 | +- -u : don't install onos.conf upstart configuration file |
14 | +- -i : don't install /etc/init.d/onos script (also used by onos.conf) | ||
15 | +- -n : don't try to start ONOS | ||
14 | - -m <settings> : pass <settings> XML file to remote maven installation | 16 | - -m <settings> : pass <settings> XML file to remote maven installation |
15 | 17 | ||
16 | options: | 18 | options: |
... | @@ -19,8 +21,7 @@ options: | ... | @@ -19,8 +21,7 @@ options: |
19 | summary: | 21 | summary: |
20 | Remotely pushes bits to a remote node and installs ONOS on it. | 22 | Remotely pushes bits to a remote node and installs ONOS on it. |
21 | 23 | ||
22 | - The [-n] flag assumes that Upstart is used. The [-f] flag depends on | 24 | + The -u should be used on upstart-based systems. |
23 | - and 'onos-config'. | ||
24 | 25 | ||
25 | If [node] is not specified the default target is \$OCI. | 26 | If [node] is not specified the default target is \$OCI. |
26 | 27 | ||
... | @@ -35,6 +36,8 @@ _EOF_ | ... | @@ -35,6 +36,8 @@ _EOF_ |
35 | while getopts fnm: o; do | 36 | while getopts fnm: o; do |
36 | case "$o" in | 37 | case "$o" in |
37 | f) uninstall=true;; | 38 | f) uninstall=true;; |
39 | + u) noupstart=true; noinitd=true;; | ||
40 | + i) noinitd=true;; | ||
38 | n) nostart=true;; | 41 | n) nostart=true;; |
39 | m) mvn_settings=$OPTARG;; | 42 | m) mvn_settings=$OPTARG;; |
40 | esac | 43 | esac |
... | @@ -69,21 +72,21 @@ ssh $remote " | ... | @@ -69,21 +72,21 @@ ssh $remote " |
69 | # TODO: use $KARAF_DATA | 72 | # TODO: use $KARAF_DATA |
70 | mkdir -p -- $ONOS_INSTALL_DIR/$KARAF_DIST/data/raft | 73 | mkdir -p -- $ONOS_INSTALL_DIR/$KARAF_DIST/data/raft |
71 | 74 | ||
72 | - # Install the upstart configuration file and setup options for debugging | 75 | + # Install the configuration file(s) and set up options for debugging |
73 | - [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/init/onos.conf /etc/init/onos.conf | 76 | + [ -n $noupstart ] && sudo cp $ONOS_INSTALL_DIR/init/onos.conf /etc/init/onos.conf |
74 | - [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/init/onos.initd /etc/init.d/onos | 77 | + [ -n $noinitd ] && sudo cp $ONOS_INSTALL_DIR/init/onos.initd /etc/init.d/onos |
75 | echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options | 78 | echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options |
76 | 79 | ||
77 | - # Setup correct user to run onos-service | 80 | + # Set up correct user to run onos-service |
78 | - echo 'export ONOS_USER="${ONOS_USER:-sdn}"' >> $ONOS_INSTALL_DIR/options | 81 | + echo 'export ONOS_USER=$ONOS_USER' >> $ONOS_INSTALL_DIR/options |
79 | 82 | ||
80 | # Remove any previous ON.Lab bits from ~/.m2 repo. | 83 | # Remove any previous ON.Lab bits from ~/.m2 repo. |
81 | rm -fr ~/.m2/repository/org/onosproject | 84 | rm -fr ~/.m2/repository/org/onosproject |
82 | 85 | ||
83 | - [ ! -z "$mvn_settings" ] && cp /tmp/settings.xml ~/.m2/settings.xml | 86 | + [ ! -z $mvn_settings ] && cp /tmp/settings.xml ~/.m2/settings.xml |
84 | 87 | ||
85 | # Drop log level for the console | 88 | # Drop log level for the console |
86 | - echo "log4j.logger.org.apache.sshd = WARN" \ | 89 | + echo 'log4j.logger.org.apache.sshd = WARN' \ |
87 | >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg | 90 | >> $ONOS_INSTALL_DIR/$KARAF_DIST/etc/org.ops4j.pax.logging.cfg |
88 | 91 | ||
89 | " | 92 | " | ... | ... |
-
Please register or login to post a comment