Using qsub from Ruby script produces "command not found"

I am running a script that runs multiple cases on an engineering code.
This engineering code is designed to use the a “qsub” (queueing system)
command.

The problem I get when trying to issue a “qsub run.sh” file (where
“run.sh” is the UNIX script interfacing the engineering code, Ruby
always terminates with a “command not found” on the qsub.

I’ve tried everything I can think of, including explicit pathways to the
qsub executable and the run.sh input. I’ve tried both the system( “qsub
run.sh” ) and qsub run.sh methods of running it.

What is going on? If I do a UNIX command line “qsub run.sh”, it runs
fine. If I do exactly the same thing within Ruby as a system command,
it fails.

How are you running the command from shell? As root?

Sincerely,

Maxim Doumkine

which qsub

/usr/local/bin/qsub

At the UNIX command line, I simply type “qsub run.sh”, and it will use
the run.sh from the submission directory. I have /usr/local/bin in my
UNIX PATH specification.

In Ruby, I’ve tried explicitly including the pathway on the qsub, to no
avail.

Here’s something else. Create a mini-Korn shell script as such:

#! /bin/ksh
qsub run.sh

Save that as “filename”, do a chmod +x to make it an executable, then do
a:

system( “filename” )

then the qsub works properly.

Why??

Executed as a different user, what user does ruby run under?

Sincerely,

Maxim Doumkine

Am 23.07.2013 02:22, schrieb Thomas L.:

run.sh" ) and qsub run.sh methods of running it.

What is going on? If I do a UNIX command line “qsub run.sh”, it runs
fine. If I do exactly the same thing within Ruby as a system command,
it fails.

Is the path where qsub is located in the search path of the shell
actually used by the Ruby system command? Have a look at:

system(“echo $PATH”)

(Different paths compared to your command line might be a login /
non-login / interactive shell issue.)

And how exactly did the command with explicit paths look like?
(It’s difficult to locate an error without seeing the used code.)

Regards,
Marcus

On Jul 23, 2013, at 5:33 AM, Max D. [email protected] wrote:

#! /bin/ksh

Why??


Posted via http://www.ruby-forum.com/.

Whatever user you ran it under

Ruby itself is not a service, although you can certainly run a ruby
program as a service (see Rails).