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.

···

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

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

Sincerely,

Maxim Doumkine

···

On Jul 22, 2013, at 20:22, Thomas Luedeke <lists@ruby-forum.com> wrote:

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.

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

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.

···

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

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??

···

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

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

···

Am 23.07.2013 02:22, schrieb Thomas Luedeke:

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.

--
<https://github.com/stomar/&gt;

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

Sincerely,

Maxim Doumkine

···

On Jul 22, 2013, at 20:43, Thomas Luedeke <lists@ruby-forum.com> wrote:

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??

--
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).

···

On Jul 23, 2013, at 5:33 AM, Max Doumkine <max@zogm.com> wrote:

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

Sincerely,

Maxim Doumkine

On Jul 22, 2013, at 20:43, Thomas Luedeke <lists@ruby-forum.com> wrote:

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??

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