X
Xavier Noëlle
Hello !
I'm stuck in a situation I don't understand and I'm looking for clues
to know what and where to search explanations.
The problem is, as stated in the title, that my subprocess is
sometimes runned using "sh -c ruby runned.rb" and sometimes directly
"ruby runned.rb" (as seen in top), depending on the system: sh -c with
Ubuntu 10.4, directly with Debian 5 and Gentoo.
The scripts are as follow:
--------------------------->8--------------------------------------
# runned.rb
puts Process.pid
puts Process.ppid
# runner.rb
def runProcess(cmd)
pid = nil
begin
pid = fork do
exec(cmd)
exit 1
end
rescue Errno::ENOENT
$stderr.puts e
end
return pid
end
runProcess('ruby "runned.rb"', true)
--------------------------->8--------------------------------------
Thanks in advance and don't hesitate to give me a Google search to
solve my problem (I tried many of them, but none worked) !
I'm stuck in a situation I don't understand and I'm looking for clues
to know what and where to search explanations.
The problem is, as stated in the title, that my subprocess is
sometimes runned using "sh -c ruby runned.rb" and sometimes directly
"ruby runned.rb" (as seen in top), depending on the system: sh -c with
Ubuntu 10.4, directly with Debian 5 and Gentoo.
The scripts are as follow:
--------------------------->8--------------------------------------
# runned.rb
puts Process.pid
puts Process.ppid
# runner.rb
def runProcess(cmd)
pid = nil
begin
pid = fork do
exec(cmd)
exit 1
end
rescue Errno::ENOENT
$stderr.puts e
end
return pid
end
runProcess('ruby "runned.rb"', true)
--------------------------->8--------------------------------------
Thanks in advance and don't hesitate to give me a Google search to
solve my problem (I tried many of them, but none worked) !