ONOS-470: Allow ONOS service to be run with customized username
Change-Id: I643b61842577f68c33bee6383638647615528da4
Showing
2 changed files
with
4 additions
and
1 deletions
... | @@ -21,7 +21,7 @@ end script | ... | @@ -21,7 +21,7 @@ end script |
21 | 21 | ||
22 | script | 22 | script |
23 | [ -f /opt/onos/options ] && . /opt/onos/options | 23 | [ -f /opt/onos/options ] && . /opt/onos/options |
24 | - start-stop-daemon --signal INT --start --chuid sdn \ | 24 | + start-stop-daemon --signal INT --start --chuid $ONOS_USER \ |
25 | --exec /opt/onos/bin/onos-service -- $ONOS_OPTS \ | 25 | --exec /opt/onos/bin/onos-service -- $ONOS_OPTS \ |
26 | >/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log | 26 | >/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log |
27 | end script | 27 | end script | ... | ... |
... | @@ -43,6 +43,9 @@ ssh $remote " | ... | @@ -43,6 +43,9 @@ ssh $remote " |
43 | [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf | 43 | [ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf |
44 | echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options | 44 | echo 'export ONOS_OPTS=debug' > $ONOS_INSTALL_DIR/options |
45 | 45 | ||
46 | + # Setup correct user to run onos-service | ||
47 | + echo 'export ONOS_USER="${ONOS_USER:-sdn}"' >> $ONOS_INSTALL_DIR/options | ||
48 | + | ||
46 | # Remove any previous ON.Lab bits from ~/.m2 repo and re-stage it. | 49 | # Remove any previous ON.Lab bits from ~/.m2 repo and re-stage it. |
47 | rm -fr ~/.m2/repository/org/onosproject | 50 | rm -fr ~/.m2/repository/org/onosproject |
48 | cp -r $ONOS_INSTALL_DIR/$KARAF_DIST/system/org/onosproject ~/.m2/repository/org/onosproject | 51 | cp -r $ONOS_INSTALL_DIR/$KARAF_DIST/system/org/onosproject ~/.m2/repository/org/onosproject | ... | ... |
-
Please register or login to post a comment