Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Sorry for the very confusing title, but here's what im trying to do:

 TORQUEBOX_START="$TORQUEBOX_HOME/jboss/bin/standalone.sh"
 TORQUEBOX_START_ARGS="--server-config=standalone-ha.xml"

start-stop-daemon --start --quiet --chuid  $DAEMONUSER  \
  --exec "${TORQUEBOX_START}" -- ${TORQUEBOX_START_ARGS}  --pidfile $PIDFILE --make-pidfile -- -c $TORQUEBOX_SERVER >> $LOGFILE 2>&1 &

I need to run the TORQUEBOX_START with its arguments in the --exec argument. I tried using -- to pass the args to it. But from there I dont really know how i can pop back to passing args to the original command. The --pidfile for example needs to pass to start-stop-daemon. Is there a way to do this or a way you can suggest?

share|improve this question
    
How about using a 3rd string to concatenate the first 2? Not pretty but should work. CMD="$TORQUEBOX_START $TORQUEBOX_START_ARGS" –  jeffatrackaid Jan 22 '13 at 15:48
    
I was initially passing it as a single string, even just hardcoding the torquebox_home path. It doesnt work quite right in single quotes, and in double quotes the --server-config argument is interpreted as an argument for start-stop-daemon –  agmcleod Jan 22 '13 at 15:52
add comment

1 Answer

up vote 0 down vote accepted

How about this?

TORQUEBOX_START="$TORQUEBOX_HOME/jboss/bin/standalone.sh"
TORQUEBOX_START_ARGS="--server-config=standalone-ha.xml"

start-stop-daemon \
  --start --quiet \
  --chuid $DAEMONUSER \
  --exec $TORQUEBOX_START \
  --pidfile $PIDFILE --make-pidfile \
  -- -c $TORQUEBOX_SERVER ${TORQUEBOX_START_ARGS} \
  >> $LOGFILE 2>&1
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.