LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-20-2009, 02:14 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
How to change the 'open file' for root permanently?


I will increase the number of 'open file' for root from default (1024) to 5000. I did first as follow:
Code:
ulimit -n 5000
Seems working. But as I login again the number returns to 1024. It seems in this way the number cannot be changed permanently.

Then I try edit the /etc/security/limits.conf as follow:
Code:
#<domain>      <type>  <item>         <value>
root             -     nofile       5000
But it doesn't work. The number is still 1024 as I list it with ulimit -a

Someone has idea?
 
Old 11-20-2009, 02:29 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by thomas2004ch View Post
I will increase the number of 'open file' for root from default (1024) to 5000. I did first as follow:
Code:
ulimit -n 5000
Seems working. But as I login again the number returns to 1024. It seems in this way the number cannot be changed permanently.

Then I try edit the /etc/security/limits.conf as follow:
Code:
#<domain>      <type>  <item>         <value>
root             -     nofile       5000
But it doesn't work. The number is still 1024 as I list it with ulimit -a

Someone has idea?
If using bash, set this in the .bash_profile assuming it is for a certain user.
If system wide, set in /etc/profile.
After setting in either of those files the activate it.

Code:
source .bash_profile or /etc/profile
then logout and back in again to test
 
Old 11-20-2009, 02:31 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
I found this at http://www.logos.ic.i.u-tokyo.ac.jp/...Linux%2Fulimit

Quote:

Changing the User Max File Descriptor Limit †
add the following lines to /etc/security/limits.conf
* soft nofile 8192
* hard nofile 8192
soft limit, is the default max value you get when you login
hard limit, is the max value to which you can raise using the ulimit command.
Change the number 8192 to 5000 in the example above, then see if it works for you.
 
Old 11-20-2009, 04:26 AM   #4
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by bigrigdriver View Post
I found this at http://www.logos.ic.i.u-tokyo.ac.jp/...Linux%2Fulimit

Change the number 8192 to 5000 in the example above, then see if it works for you.
Your example
Code:
* soft nofile 8192
is not good. This will change all the other user's 'OpenFile' limit.
 
Old 11-20-2009, 04:31 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Original Poster
Rep: Reputation: 33
Quote:
Originally Posted by centosboy View Post
If using bash, set this in the .bash_profile assuming it is for a certain user.
If system wide, set in /etc/profile.
After setting in either of those files the activate it.

Code:
source .bash_profile or /etc/profile
then logout and back in again to test
You mean set the 'open file' limit in .bash_profile?
 
  


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
sed to change some values in a file permanently tanveer Linux - General 2 03-23-2008 01:17 PM
change file permission of a mouse device file permanently alexandre_fs Linux - General 5 01-09-2007 06:30 AM
Root cannot change file permissions. aje Slackware 3 08-12-2005 02:27 AM
Can't permanently change path SuperRunt Linux - Newbie 11 02-02-2005 11:59 PM
Root can't change file permissions!!!!!! j_pooria Fedora 1 08-19-2004 03:29 AM

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

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