•
•
•
•
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
![]() |
•
•
Join Date: May 2006
Posts: 12
Reputation:
Rep Power: 3
Solved Threads: 0
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.)
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.)
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
see: http://www.daniweb.com/techtalkforums/forum33.html
drink her pretty
![]() |
•
•
•
•
•
•
•
•
DaniWeb Python Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Web-Based Applications Developer needed in Silicon Valley (Software Development Job Offers)
- IE- persistant and subtle Search engine problem (Viruses, Spyware and other Nasties)
- Python/Tkinter and the Web (Python)
- Python CGI and html enctype conflict? (Python)
- ps2pdf problems in Python (Python)
- popen2 problem (Python)
- get posted form data in python (Python)
- weird cgi problem (Linux Servers and Apache)
Other Threads in the Python Forum
- Previous Thread: class (builtin?) methods
- Next Thread: Python - Functions



Linear Mode