[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problems with a CGI script
From: |
Benedikt Stefansson |
Subject: |
Re: Problems with a CGI script |
Date: |
Sun, 26 Jul 1998 15:19:28 -0700 |
Thanks Alessandro,
I tried your idea and still couldn't get it to work. Then after fiddling around
for a few more hours I hit upon calling the Swarm program with a line like this
in the Perl program:
system "/bin/bash -c '(export HOME=$home\;$run/$program -b)'\;";
Here $home is the home directory of the user nobody, $run is the directory
where the Swarm executable is stored and $program is the name of the program.
This works, because I spawn a new bash shell and export the HOME env variable
within the subshell.
Thanks for your help.
Regards,
-Benedikt
Perrone Alessandro wrote:
> Hi
>
> >I've been writing some CGI scripts to allow me to interface with my
> >simulations and view results on the web, but the sophstication of Swarm
> >1.1. is getting me into trouble.
> That's very interesting.
> I was thinking of doing a similar thing, too.
>
> >It seems that the web server (Apache) executes the CGI script (a Perl
> >program) as user nobody. However, when the Perl script calls the Swarm
> >simulation (invoking batch mode of course), the program crashes on the
> >first invocation of the -create: setC: method in String.m, called by the
> >Archiver, line String.m:65. I can't debug this CGI invoked session
> >directly of course, but my hunch is that assert() fails because cstring
> >is a null pointer, where in this case it should contain the home
> >directory of the user. User nobody has a home, but for some reason, in
> >this case, the environment variable isn't defined.
> Have you tried to "call" the Swarm simulation indirectly, not through the
> perl script? Maybe call a file which call the simulation?
> In the PerlScript you can "call" a file on your Home directory which has
> within a line like this
> ---
> ./swarmSimulation -batchmode
> --
> (of course with x permission).
>
> I thought to use shell scripts to do the call of the simulation, not the
> Perl script. Maybe when you call the simulation, as you say, you loose, for
> some reasons, the evironment variable.
> Tomorrow I'll try my idea, and then I'll put the result on this list.
> Best regards.
> ALEX
>
> --
> ,,,,
> /'^'\
> ( o o )
> -oOOO--(_)--OOOo---------------------------------------------------
> Amo parlare di niente,
> E' l'unico argomento di cui so tutto.
> .oooO Alex Perrone - address@hidden address@hidden
> ( ) Oooo. Home Page: http://venus.unive.it/~alex
> ---\ (----( )----------------------------------------------------
> \_) ) /
> (_/
>
> ==================================
> Swarm-Support is for discussion of the technical details of the day
> to day usage of Swarm. For list administration needs (esp.
> [un]subscribing), please send a message to <address@hidden>
> with "help" in the body of the message.
> ==================================
--
----------------
Benedikt Stefansson address@hidden
Department of Economics, UCLA Fax. (310) 825-9528
Los Angeles, CA 90095-1477 Tel. (310) 825-1777
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
==================================