System waits for start

Hi,

The following spawns a new process (Notepad.exe) on Windows and then
immediately returns when ran with ruby 1.8:
system(‘start notepad’)
‘start’ is the command-line command for spawning a separate process that
will live on.

With jruby (both 1.3.1 amd 1.4) it hangs until Notepad is stopped.
The same applies for:
system(‘cmd /C start notepad’)
system(‘start’, ‘notepad’)
system(‘cmd’, ‘/C’, ‘start’, ‘notepad’)

Is there a way to spawn a process in jruby on Windows and not having to
wait
for it?

/Mikael

Hi Mikael,

Interesting… Please file a bug report against JRuby:

http://jira.codehaus.org/browse/JRUBY

Thanks,
–Vladimir

On Mon, Dec 21, 2009 at 1:51 PM, Mikael P. [email protected]
wrote:

system(‘cmd /C start notepad’)
system(‘start’, ‘notepad’)
system(‘cmd’, ‘/C’, ‘start’, ‘notepad’)

Is there a way to spawn a process in jruby on Windows and not having to wait
for it?

/Mikael


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I think if you just use backticks it will work. So try:

start notepad

Joe

Jruby has some interest behaviors in that it is set to do backtick
type operations as “inproc” by default.

There is a jruby property to change this behavior:

jruby.launch.inproc=true|false
   Set in-process launching of e.g. system('ruby ...'). Default is 

true

Try with this property set to false to see if you get different
behavior?

Jay

On Mon, Dec 21, 2009 at 12:03 PM, Joseph A. [email protected]
wrote:

system(‘cmd’, ‘/C’, ‘start’, ‘notepad’)

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I concur with filing a bug. The “start” process should itself spawn
off a new process and then complete, but perhaps the way we’re
launching processes using Java’s APIs doesn’t want to terminate until
all children terminate?

On Mon, Dec 21, 2009 at 6:51 AM, Mikael P. [email protected]
wrote:

system(‘cmd /C start notepad’)
system(‘start’, ‘notepad’)
system(‘cmd’, ‘/C’, ‘start’, ‘notepad’)

Is there a way to spawn a process in jruby on Windows and not having to wait
for it?

/Mikael


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email