On Tue, May 08, 2012 at 08:20:38AM -0700, Sean P. DeNigris wrote:
> 
> Sean P. DeNigris wrote
> > 
> > How do I circumvent all the processing and tell OSP what args to actually
> > pass to the underlying system?
> > 
> 
> I found a solution:
>   env := CommandShell new environment.
>   pwd := '/'.
> args := Array
>       with: '-DJENKINS_HOME=/path with spaces/.jenkins'
>       with: '-jar'
>       with: '/path/with/another space/jenkins.war'
>       with: '--httpPort=####'
>       with: '--ajp13Port=####'.
> desc := (Array with: nil with: nil with: nil).
> p := PipeableOSProcess
>       new: '/usr/bin/java'
>       arguments: args
>       environment: env
>       descriptors: desc
>       workingDir: pwd
>       errorPipelineStream: nil.
> 
> Since I'm not doing any redirecting, this works. If you have to redirect, it
> looks like the best move would be to go through ProxyPipeline, like Dave
> suggested, but define and plugin a custom ShellSyntax that does not do any
> string processing...

Sean,

This is a good solution. It does exactly what you want, and the command
parameters are clearly specified without relying on either /bin/sh or
ShellSyntax to do the parsing.

One last pointer: When Jenkins is done and your external process exits,
it is good practice to close any open file descriptors (p closePipes).
This will prevent file handle leaks if you run Jenkins on a regularly
scheduled basis.

Dave


Reply via email to