LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 03:14 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Rep: Reputation: 32
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, 03: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, 03:31 AM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Jessie 8.4
Posts: 5,873

Rep: Reputation: 348Reputation: 348Reputation: 348Reputation: 348
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, 05:26 AM   #4
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
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, 05:31 AM   #5
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 537

Original Poster
Rep: Reputation: 32
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


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


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