tesswulf has asked for the wisdom of the Perl Monks concerning the following question:

I am running Perl CGI scripts via the Apache v1.3.28 server in a Unix environment, is there settings that should be taken care of when running command line in this particular case for mpirun (the script alias has already been set up -
ScriptAliasMatch .../cgi-bin/... /usr/users/$1/public_html/cgi-bin/$2) :

The line in Perl script is :

`/usr/local/apps/mpich/bin/mpirun -machinefile /usr/users/ueug/machine +s.ALPHA -np 2 /usr/users/ueug/mpiblast/src/mpiblast --config-file=/us +r/users/ueug/mpiblast/mpiblast.conf -p blastn -d ecoli.nt -i /usr/use +rs/ueug/public_html/cgi-bin/upload/100seq -o /usr/local/tmp1/d.txt 2> + /usr/local/tmp1/err.txt`;

The relevant error is :

/usr/local/apps/mpich/bin/mpirun: pwd: read error in .. /usr/local/apps/mpich/bin/mpirun: test: argument expected

Is there anything that should be taken care of when running scripts of this nature? Even when "nobody" user account has been set to a writable directory such that I could execute the command in "nobody"'s account I still could not execute the command via Perl script.

Is it a problem with the server configuration since "nobody"'s account can execute the command?

BazB added code tags

Replies are listed 'Best First'.
Re: Perl execution of MPIRUN commands
by tilly (Archbishop) on Feb 16, 2004 at 16:12 UTC
    I would suggest that you start by assuming that the error means what it says. Likely something in /usr/local/apps/mpich/bin/mpirun expected an argument and didn't get it.

    If you have source for the code emitting the error, you could look for where that message might come from. You can also try running the problematic code by hand and see if you can track down the debugging problem.

    (If you have source, then I'd suggest more informative debugging errors. See what perlstyle has to say on that topic for some good tips.)

      The source is provided by me! Thats the line... mpirun causes the error... but the same command works fine if run directly from command prompt....
        Try running the command from a command prompt while logged in as the user that the webserver runs, with the environment that the webserver has.

        There is a difference between how you are running the command and how the webserver does (as evidenced by the fact that the webserver produces an error). Figure out what that difference is and you are more than half-way to solving your problem.

Re: Perl execution of MPIRUN commands
by Abigail-II (Bishop) on Feb 16, 2004 at 15:37 UTC
    While it's hard to read your post, I don't think your question is a Perl question. It might have to do with your web server configuration, or some issue with the local command you are trying to run.

    Abigail

      The command runs perfectly at command prompt be it in my own user login or "nobody"'s login.

      So its either Perl... is my command line too long?

      Or... Apache... or Unix...

      But I am really at a lost, could an enlightened monk please show me the way?

        As I said, it's not Perl. Remember that your environment (UID, EUID, GID, EGID, environment variables, current working directory, etc,) are different from running a program from the command line, and running it via a webserver.

        Abigail