LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-16-2017, 02:16 PM   #1
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
CentOS 7: ulimit using "strange" value.


The hard and soft ulimits for "max user processes"
is 3889.
But in 20-nproc.conf , it is 4096 and unlimited.
Where does the 3889 come from?

Code:
$ ulimit -u
3889
$ ulimit -a | grep -i process
max user processes              (-u) 3889
$ ls
20-nproc.conf
$ cat 20-nproc.conf 
# Default limit for number of user's processes to prevent
# accidental fork bombs.
# See rhbz #432903 for reasoning.

*          soft    nproc     4096
root       soft    nproc     unlimited

$ ulimit -H -u
3889

#Nothing is set in in /etc/security/limits.conf
 
Old 03-16-2017, 08:46 PM   #2
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 423

Rep: Reputation: Disabled
mine reads a different value and i had not set it to any

/* maxchild = sysconf (_SC_CHILD_MAX); */

it's likely based on either who built bash (if they put in a hard limit), your system or kernel headers (if they aren't incorrect - they can get mangled)

TRY THIS:

# sysctl -a

the real answer should be that it was taken from kernel resources and depends on more than one resource (ie to run a process you need enough kernel resources to use that process at least for forking) - but likely the setting is simply "somewhat arbitrary"

but you'll have to either use sysctl and set it yourself, or read the source and compile bash the way you want it, if you want to set a limit given some agenda (ie, a ulimit design for limiting max telnet logins a shell spawns - far different from kernel child limit)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How can i show usage of the ulimit "open files" and why this is important? postcd Linux - General 6 03-16-2017 12:59 PM
"Difference between centos and slackware" and "also how to install scratch on centos" vijayendra.uppalapati Slackware 4 07-13-2012 12:10 AM
Setting "ulimit" is Not Working and Throwing Errors devUnix Solaris / OpenSolaris 8 02-13-2012 02:04 PM
"Difference between centos and slackware" and "also how to install scratch on centos" vijayendra.uppalapati Slackware 2 01-23-2011 04:14 AM
Strange "characters" appearing in auto "created" man pages Sector11 Linux - General 7 02-28-2010 12:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:42 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration