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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-13-2009, 03:35 AM
|
#1
|
Member
Registered: Aug 2009
Posts: 539
Rep:
|
How can I change the limit of 'Open Files' in ulimit?
I can use the ulimit -a to list the open file. The 'Open Files' is 1024.
Code:
-bash-2.05b$ ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 4
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited
Now I want to to increase the number. How can I do that?
Besides, I will change this 'Open Files' not for /root but for a sub-user.
Last edited by thomas2004ch; 11-13-2009 at 03:43 AM.
|
|
|
11-13-2009, 03:45 AM
|
#2
|
Member
Registered: Aug 2009
Posts: 539
Original Poster
Rep:
|
I tried as follow but failed:
I got error:
Code:
ulimit: open files: cannot modify limit: Operation not permitted
|
|
|
11-13-2009, 06:16 AM
|
#3
|
Member
Registered: Dec 2007
Location: India
Distribution: fedora 11
Posts: 64
Rep:
|
Quote:
Originally Posted by thomas2004ch
I tried as follow but failed:
I got error:
Code:
ulimit: open files: cannot modify limit: Operation not permitted
|
-n option is correct, but you have root access.
- maniannam
|
|
|
11-17-2009, 03:37 AM
|
#4
|
Member
Registered: Aug 2009
Posts: 539
Original Poster
Rep:
|
Quote:
Originally Posted by maniannam
-n option is correct, but you have root access.
|
I don't understand what you mean "you have root access" here. Do you mean I have to login as root? I can do this when I login as root. But this will change all the 'open files' to all users. This is what I don't want. I just want to change one of the user's 'open files'.
|
|
|
11-17-2009, 03:53 AM
|
#5
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Rep:
|
I think , you must see
/etc/security/limits.conf
thanks
|
|
|
11-17-2009, 04:10 AM
|
#6
|
Member
Registered: Aug 2009
Posts: 539
Original Poster
Rep:
|
Quote:
Originally Posted by vishesh
I think , you must see
/etc/security/limits.conf
thanks
|
Here is my 'limits.conf'. How can I change?
Code:
[root@s003ap05-test ~]# cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain> <type> <item> <value>
#
#Where:
#<domain> can be:
# - an user name
# - a group name, with @group syntax
# - the wildcard *, for default entry
# - the wildcard %, can be also used with %group syntax,
# for maxlogin limit
#
#<type> can have the two values:
# - "soft" for enforcing the soft limits
# - "hard" for enforcing hard limits
#
#<item> can be one of the following:
# - core - limits the core file size (KB)
# - data - max data size (KB)
# - fsize - maximum filesize (KB)
# - memlock - max locked-in-memory address space (KB)
# - nofile - max number of open files
# - rss - max resident set size (KB)
# - stack - max stack size (KB)
# - cpu - max CPU time (MIN)
# - nproc - max number of processes
# - as - address space limit
# - maxlogins - max number of logins for this user
# - maxsyslogins - max number of logins on the system
# - priority - the priority to run user process with
# - locks - max number of file locks the user can hold
# - sigpending - max number of pending signals
# - msgqueue - max memory used by POSIX message queues (bytes)
#
#<domain> <type> <item> <value>
#
#* soft core 0
#* hard rss 10000
#@student hard nproc 20
#@faculty soft nproc 20
#@faculty hard nproc 50
#ftp hard nproc 0
#@student - maxlogins 4
apache - nofile 5000
# End of file
[root@s003ap05-test ~]#
|
|
|
11-17-2009, 04:20 AM
|
#7
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Rep:
|
root# vi /etc/security/limits.conf
(Enter following two lines at end of file by replaceing username )
<username> soft nofile 25
<username> hard nofile 30
--
here 25 and 30 are soft and hard limit corresponding.
Thanks
Last edited by vishesh; 11-17-2009 at 04:31 AM.
|
|
|
11-17-2009, 05:09 AM
|
#8
|
Member
Registered: Aug 2009
Posts: 539
Original Poster
Rep:
|
Quote:
Originally Posted by vishesh
root# vi /etc/security/limits.conf
(Enter following two lines at end of file by replaceing username )
<username> soft nofile 25
<username> hard nofile 30
--
here 25 and 30 are soft and hard limit corresponding.
Thanks
|
Thanks.
But if I do as follow:
Code:
<username> - nofile 25
What is the difference?
|
|
|
11-17-2009, 05:12 AM
|
#9
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Rep:
|
I think 25 will be your limit of open files.
Thanks
|
|
|
11-17-2009, 05:16 AM
|
#10
|
Member
Registered: Aug 2009
Posts: 539
Original Poster
Rep:
|
Quote:
Originally Posted by vishesh
I think 25 will be your limit of open files.
Thanks
|
Does this mean in my case both hard and soft has limit of 25?
|
|
|
11-17-2009, 05:21 AM
|
#11
|
Member
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661
Rep:
|
Yes, i am not 100% sure but i think both hard and soft will limit of 25.
Thanks
Last edited by vishesh; 11-17-2009 at 05:24 AM.
|
|
|
All times are GMT -5. The time now is 05:27 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|