LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-23-2019, 01:21 AM   #1
mike_canada
LQ Newbie
 
Registered: Jul 2019
Posts: 23

Rep: Reputation: Disabled
setting system resource limits in CGI application


I have a test system. Its Slackware 13 with adequate global ulimits (which I can find with ulimit -a). I run apache on this system to serve my CGI files and the username that runs the CGI through apache is "nobody". My CGI runs fine.

I also have a target system which is "Damn Small Linux Not" which is knoppix and kernel 2.6.12 but its resources aren't as well configured for my needs. It uses the "Monkey" web server. It doesn't run parts of my CGI well at all, yet when I tried the same CGI code with "Damn Small Linux" with kernel 2.4.19, it works but I haven't checked the limits there.


So what I'd like to be able to do is set a high memory lock limit (from the default of 32KB for "Damn Small Linux Not" to 4096KB like I have on Slackware).

Is there a way I can do it on the active CGI user in "Damn Small Linux Not" while logged in as the root user?
 
Old 07-24-2019, 09:48 AM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
I'm pretty sure that you can't set the limits for a user higher than the global limits set with ulimit.
Just set the ulimit as needed.
 
Old 07-24-2019, 01:06 PM   #3
mike_canada
LQ Newbie
 
Registered: Jul 2019
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by scasey View Post
I'm pretty sure that you can't set the limits for a user higher than the global limits set with ulimit.
Just set the ulimit as needed.
Here's the crazy part.

The target machine for all the processing will eventually be a thin client with a 128MB SSD drive as a hard drive and I'm trying different flavors of linux as we speak, but for now I'm using another machine with plenty of resources.

I tried "Damn Small Linux" and it loads a 2.4 kernel. Everything is fine except the serial port implementation is broken (It names the serial port files ttyS00 and ttyS01 but they're never listed in /dev)

Now I'm using "Damn Small Linux NOT" (kernel 2.6) but it used double the space I have available for the target machine. Its serial implementation appears correct but adjusting ulimit is a pain. Its still stuck at 32K for max locked memory.

I did modify /etc/security/limits.conf to make the value higher for all users in question (root, dsl, and nobody) and I even modified a startup script manually and inserted "ulimit" commands to insert the new limits that way because I figured that would be a global limit to all processes.

To my dismay, the limit (hard and soft) is STILL stuck at 32 and the only way I can seem to adjust the limit for new processes is to put in the ulimit command before running the program, but the monkey webserver doesn't have a configuration that supports the ability for "ulimit" to be executed just before the script is run.

What other files could I modify?

It seems all the "Damn small linux" OS's are based on knoppix and I think a bit of debian.
 
Old 07-24-2019, 02:41 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,751

Rep: Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929Reputation: 5929
Have you tried running tinycore?

https://distrowatch.com/table.php?distribution=tinycore
 
Old 07-24-2019, 03:52 PM   #5
mike_canada
LQ Newbie
 
Registered: Jul 2019
Posts: 23

Original Poster
Rep: Reputation: Disabled
Yes but now I'm sticking with "Damn Small Linux" the original. It works for everything but I just have to remember the dmesg output for the serial ports is incorrect since it adds a "0" to the dmesg but when I tested the ports with the normal name, everything works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
soft and hard limits for nproc value in /etc/security/limits.conf file kraljic Linux - General 3 07-13-2015 08:13 AM
Soft limits and hard limits of process gaurav_s Linux - Software 4 01-06-2015 09:57 AM
Setting limits in /etc/security/limits.conf vaibhav.vsk Linux - Security 1 09-20-2012 08:22 AM
setting resource limits for jobs... pointfielder Red Hat 1 11-01-2006 06:34 AM
limits are not working (limits.conf) PkerC Red Hat 3 06-22-2006 10:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration