From: Harmanpreet S. <har...@gm...> - 2012-10-15 20:04:55
|
I am creating a web application (using CGI) which act as an interface between user and BRLCAD. User gives input from browser through HTML form (inputs like database name, object type, object name etc.) and ultimately after processing, a shell script is created, which when executed, a rendered image will displayed back onto browser. But I stuck with the problem of mged command's non execution in the shell script. When I run this shell script from browser, mged command failed to execute (command is correct, tested separately), but when script run from command line (using Ubuntu, 12.4 LTS), it executed successfully. I failed to point out, why this is happening? I experimented by inserting some normal Linux commands like 'ls', 'pwd' etc and by changing user identity to www-data user and then run script on command line, it run successfully. Now it is strange; since browser and www-data both are same user, but when script run through browser it doesn't worked (only mged command fails, all Linux commands worked and displayed output on browser every time), when from command line, it worked and .g file created. Only mechanism is different, user is same, then why via browser script failed? I further experimented, I redirect script's output to a text file. Now, every output which was to be displayed onto screen should go to text file. This thing happened only with Linux commands but not with those of mged. The output of mged command which marks its successful execution i.e. name of objects created, appeared on screen but not directed to standard output i.e. text file. So, one more question is why the output of mged commands is not redirected to standard output, but to default output only? -- Harmanpreet Singh |