LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-05-2011, 02:07 AM   #1
suhas!
Member
 
Registered: Mar 2007
Posts: 100

Rep: Reputation: 17
Where does default ulimit values come from?


Hi,

This may look like newbie question. But I've asked many folk, but couldn't get an answer.


The problem: We have several servers running exact same version of OS (Centos 5.5) and same version of bash. However, there is one server having different ulimit values than rest. It is set with around 500M of virtual memory ulimit. Below is the output.


# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 168064
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) 524288
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) 524288
file locks (-x) unlimited


I checked in .bashrc, .bash_profile, bashrc, profile, profile.d/*, limits.conf, rc.local, but there is no where I could find this virtual memory of 500M. (On rest of the servers as well, unlimited virtual memory is defined no wehre). Where does this default value come from. How can I change the default. I know I can anytime override it via any of above files, but where is this default set.


Regards,
 
Old 03-05-2011, 03:05 AM   #2
kaushalpatel1982
Member
 
Registered: Aug 2007
Location: INDIA
Distribution: CentOS, RHEL, Fedora, Debian, Ubuntu, LinuxMint, Kali Linux, Raspbian
Posts: 166

Rep: Reputation: 10
Go through the link below :

http://tldp.org/LDP/solrhe/Securing-...1.3/x4733.html
 
Old 03-05-2011, 04:57 AM   #3
suhas!
Member
 
Registered: Mar 2007
Posts: 100

Original Poster
Rep: Reputation: 17
Angry

Quote:
Originally Posted by kaushalpatel1982 View Post
Once again, this is not a newbie question and above link does not answer my question.. As I already said, all possibilities about .bashrc, .bash_profile and so on are ruled out..

I know how can I override that value, just want to know why do I have to override it on one server, if other servers are running fine with their defaults..
 
Old 03-05-2011, 05:13 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
The ulimit command is built into the bash shell and provides limits for specific application.
In general they are set in
Quote:
/etc/bash.bashrc
If this doesn't exist look in
Quote:
/etc/security/limits.conf
Kind regards
 
Old 03-05-2011, 05:15 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

The following information might be also usefull:
http://www.kernel.org/pub/linux/libs...am_limits.html

Kind regards,

Eric
 
1 members found this post helpful.
Old 11-06-2012, 03:40 PM   #6
gpassala
LQ Newbie
 
Registered: Nov 2012
Posts: 2

Rep: Reputation: Disabled
Has this question been answered?
I cannot seem to find this anywhere.
I was wondering where does Linux set the default ulimit settings.
The /etc/security/limits.conf will overwrite the defaults, but I cannot find where those default settings are located.
Are they set in the Kernel?
 
Old 11-07-2012, 03:41 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
/etc/security/limits.conf ARE the default settings.
 
Old 11-07-2012, 07:46 AM   #8
gpassala
LQ Newbie
 
Registered: Nov 2012
Posts: 2

Rep: Reputation: Disabled
Chris,

I have checked that file, and I do not see the default settings.
I currently have one user with ulimits defined in that file.
When I check the ulimit values of other user, they are different.
Therefore, there must me a different location where they are defined (could it be in the kernel?).

Thanks,
Gino
 
Old 11-07-2012, 07:14 PM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You're right; could have sworn that was it....
I'm sure I've seen a file somewhere that does have all the default settings... maybe Solaris.

Anyway, having googled around and looked at man pages, it (unfortunately) looks like they are set in various places eg kernel modules etc and some conf files.

I'll try to check back later to see if anyone has a definitive / better answer
 
Old 12-13-2012, 04:57 PM   #10
CeriDavies
LQ Newbie
 
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
/etc/security/limits.conf not working

I'm running on Oracle Linux 5 (a flavor of RHEL5), and am noticing the values in /etc/security/limits.conf is not working...
Here is what is in my file:
* - core unlimited

Answered by own question: Its being overridden/set in /etc/profile to 0, so add the above entry to /etc/security/limits.conf
and comment out the setting in /etc/profile and it works (for all users including root).
Thought I'd still post, since it may help someone else
 
  


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
ulimit -s 40960 vs ulimit ulimit -s 10240 centguy Linux - Software 2 10-22-2016 11:38 PM
[SOLVED] set ulimit values kopper27 Linux - Newbie 2 03-18-2010 06:10 PM
default ulimit lock value? despotic Slackware 5 11-05-2006 05:04 PM
Setting ulimit values in files on Redhat AS 2.1 Darrell22 Linux - Newbie 0 06-29-2004 07:53 PM
useradd with default values ?! realos Linux - Newbie 1 08-09-2002 07:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:39 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