User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 425,929 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,706 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser: Programming Forums
Views: 1169 | Replies: 1
Reply
Join Date: May 2006
Posts: 12
Reputation: gbs is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
gbs gbs is offline Offline
Newbie Poster

Help A subtle python cgi problem

  #1  
Oct 24th, 2006
Greetings,

In a Python script ("test.py"), I used os.system to execute a c executable "grerand", like below:

os.system ("./grerand sequence sequence 1000")

If I use this script as a CGI script and invoked it via the web (in this case, the invoking user is an apache user). It gave me segmentation fault.

However, as I logged into the server as "root", ran a "ulimit -s unlimited" and then ran this script manually ("python test.py"). It succeeded.

I guess the problem is that "root" has unlimited stack size while "apache" users have some limited stack size. So I tried to modify the /etc/security/limits.conf" file to increase all users' stack size by adding
"* soft stack unlimited"
and
"* hard stack unlimited". I rebooted the server and tried to invoke the script as a web user (apache user). It failed.

I also tried to modify the httpd.conf by adding "ThreadStackSize 65536*1024" (64MB should be bigger enough). The script still failed.

I wonder how to effectively increase the stack size for apache users? (I am using a redhat enterprise linux.)
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2005
Posts: 1,133
Reputation: Ene Uran is an unknown quantity at this point 
Rep Power: 6
Solved Threads: 66
Ene Uran's Avatar
Ene Uran Ene Uran is offline Offline
Veteran Poster

Re: A subtle python cgi problem

  #2  
Oct 24th, 2006
Your problem might be one of Networking. There is actually a subforum on DaniWeb called "Linux Web Hosting and Apache"
see: http://www.daniweb.com/techtalkforums/forum33.html
drink her pretty
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Python Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Python Forum

All times are GMT -4. The time now is 9:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC