Reputation: 487
I'm trying to build an upstart configuration that's used in combination with monit.
I'd like to pass some arguments to vertx as well (multiple instances of the verticle), but I'm failing to get a proper statement on the shell already, so I think there's no need to quote the upstart script.
start-stop-daemon --start --chdir /my/app/dir --exec /usr/bin/vertx runzip myverticle-mod.zip -instances 20
No idea how to pass the '-instances 20' arg to the exec statement, somehow it is always interpreted as option to start-stop-daemon
start-stop-daemon: invalid option -- 'i'
I already tried putting the whole --exec statement into braces...
Upvotes: 2
Views: 3059
Reputation: 487
Maybe I missed something in Unix basics and didn't manage to properly escape the --exec string, so my pragmatic approach/workaround was creating a custom parameterized start script:
#!/bin/sh
export JAVA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=$1 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=192.168.0.100"
/usr/bin/vertx runzip $2 -instances $3
Upstart config (running 10 instances of a verticle via JMX RMI on port 33002)
script
VERTX_OPTS=" 33002 mymodule-mod.zip 10"
exec start-stop-daemon --start --exec /usr/bin/myVertxStartup --$VERTX_OPTS
end script
Upvotes: 1