keith-turner commented on issue #957: Fluo scripts copy jars into fluo software 
dir.
URL: https://github.com/apache/fluo/issues/957#issuecomment-339345394
 
 
   Great @mptap, let us know if you have any questions.   
   
   @ctubbsii the trap command is neat, I didn't know about that.  I have never 
done signal handling bash.  I googled it, seems one may be able to use human 
readable signal codes like `ERR` and `INT` instead of numbers. I got a little 
lost w/ all the quoting in the trap command, I suspect its expanding the 
variable and still leaving it quoted after expanding.
   
   I think using the trap command to schedule the deletion on process exit is 
the way to go.  I tried to redo my example from above using trap, not sure if 
its correct.
   
   ```bash
       app_lib=$(mktemp -d "$FLUO_TMP"/fluo-"$app"-XXXXXXXXX) || die "fatal: 
unable to allocate a temporary directory"
       # sechedule removal of app_lib tmp dir when this script exits
       trap "rm -rf '""$app_lib""'" 0 HUP INT QUIT TERM
       $JAVA org.apache.fluo.command.FluoGetJars -d "$app_lib" -a "$app"
       export CLASSPATH="$conf:$app_lib/*:$CLASSPATH"
       $JAVA org.apache.fluo.command.FluoExec "${@:2}"
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to