Charles M.C. Chan

ONOS-470: Allow ONOS service to be run with customized username

Change-Id: I643b61842577f68c33bee6383638647615528da4
......@@ -21,7 +21,7 @@ end script
script
[ -f /opt/onos/options ] && . /opt/onos/options
start-stop-daemon --signal INT --start --chuid sdn \
start-stop-daemon --signal INT --start --chuid $ONOS_USER \
--exec /opt/onos/bin/onos-service -- $ONOS_OPTS \
>/opt/onos/var/stdout.log 2>/opt/onos/var/stderr.log
end script
......
......@@ -43,6 +43,9 @@ ssh $remote "
[ -z "$nostart" ] && sudo cp $ONOS_INSTALL_DIR/debian/onos.conf /etc/init/onos.conf
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
# Remove any previous ON.Lab bits from ~/.m2 repo and re-stage it.
rm -fr ~/.m2/repository/org/onosproject
cp -r $ONOS_INSTALL_DIR/$KARAF_DIST/system/org/onosproject ~/.m2/repository/org/onosproject
......