vertx-deploy-tools
vertx-deploy-tools copied to clipboard
use VERTX_OPTS instead of JAVA_OPTS for default files
bin/vertx parses VERTX_OPTS instead of JAVA_OPTS this means that the JAVA_OPTS used in /etc/default/APPLICATION is empty when vertx is called. You only notice this when you try to use the init script to restart the verticles.
I created a workaround by adding this in the vertx init script: VERTX_OPTS=$JAVA_OPTS
But it would be "cleaner" if VERTX_OPTS is used in the default file instead of JAVA_OPTS
The context in our version of the vertx init script:
start_applications () {
for f in $APPLICATIONS;
do
APPLICATION=`echo $f | sed "s/.*\///"`
RUNNING=`ps ax | grep [v]ertx.id=${APPLICATION%:*}`
if [ -n "$RUNNING" ]; then
echo "${APPLICATION%:*} already running";
continue
fi
[ -f /etc/default/${APPLICATION%:*} ] && . /etc/default/${APPLICATION%:*}
VERTX_OPTS=$JAVA_OPTS
su $VERTX_USER -c " cd $VERTX_HOME; $DAEMON start maven:$APPLICATION -conf $CONFIG -cluster --java-opts $JAVA_OPTS --instances $INSTANCES -id $APPLICATION"
done
}
small correction: VERTX_OPTS=$JAVA_OPTS
should be: export VERTX_OPTS=$JAVA_OPTS
the root cause is actually the --java-opts $JAVA_OPTS in the call to starting vertx, which is not correct and should be: --java-opts="$JAVA_OPTS"