A
Ara.T.Howard
i'm working on a clustering system that runs jobs submitted to an nfs mounted
queue from n feeding nodes. currently it's linux only and i use the following
to ensure a users job is executed on the remote node with the environment they
are accustomed to
cmd = 'ls -ltar'
pipe = IO.pipe
unless((cid = fork))
pipe.last.close
STDIN.reopen pipe.first
exec 'bash --login'
else
pipe.first.close
pipe.last.puts cmd
end
therefore there job executes in a login shell and their 'normal' environment
is there. how would one go about this one windows? obviously the fork has to
go but i'm getting around that by opening up a pipe to another ruby process
using IO.popen and sending a little ruby program down the pipe in order to be
able to fork/exec the job. this is being done so i can make the child ruby
process do things like write me the pid back, redirect stdin/stdout, etc. -
all in a portable way...
thoughts?
-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it.
| --Dogen
===============================================================================
queue from n feeding nodes. currently it's linux only and i use the following
to ensure a users job is executed on the remote node with the environment they
are accustomed to
cmd = 'ls -ltar'
pipe = IO.pipe
unless((cid = fork))
pipe.last.close
STDIN.reopen pipe.first
exec 'bash --login'
else
pipe.first.close
pipe.last.puts cmd
end
therefore there job executes in a login shell and their 'normal' environment
is there. how would one go about this one windows? obviously the fork has to
go but i'm getting around that by opening up a pipe to another ruby process
using IO.popen and sending a little ruby program down the pipe in order to be
able to fork/exec the job. this is being done so i can make the child ruby
process do things like write me the pid back, redirect stdin/stdout, etc. -
all in a portable way...
thoughts?
-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it.
| --Dogen
===============================================================================