[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to set permanent ulimit



i wrote this two lines:


*    hard    nofile    10240
*    soft    nofile    10240

in /etc/security/limits.conf, reboot
but its now working.

On k, 2010-01-26 at 17:03 -0500, Stephen Powell wrote:
> On 2010-01-26 at 16:44:33 -0500, Stephen Powell wrote:
> > In /etc/security/limits.conf, add the following line:
> > 
> >    database    hard    nofile   10240
> > 
> > In /home/database/.bash_profile add the following line:
> > 
> >    ulimit -n 10240
> 
> I just thought of another way, which I think is even better.
> In /etc/security/limits.conf, add *two* lines, in this order:
> 
>      database    hard    nofile    10240
>      database    soft    nofile    10240
> 
> That way, you don't have to mess with a bash profile.  And it
> should affect daemons too, without modifying their startup
> scripts.  If you want the change to affect all users, change
> the word "database" to an asterisk (*).  If you want it to
> affect all members of a group, use an "at sign" (@) in front
> of the group name, such as @sys.
> 
> ----- Original Message -----
> From: Stephen Powell <zlinuxman@wowway.com>
> To: debian-user@lists.debian.org
> Sent: Tue, 26 Jan 2010 16:44:33 -0500 (EST)
> Subject: Re: how to set permanent ulimit
> 
> On 2010-01-26 at 15:53:37 -0500, Vadkan Jozsef wrote:
> > so the question still is: how can I set ulimit to be permanent? e.g.:
> > 10240 after reboot? :D
> >
> > there's no way for it?:O
> 
> I believe that Alex and I just told you, in effect.
> But if you need detailed instructions, OK.  :-(
> 
> First of all, it depends on whether you want this limit changed for
> all users, all users of a group, or just one user, such as a database
> server's userid.  I'll give you an example for a single user.
> I hope you can adapt these instructions if that's not the case.
> Let's suppose that user "database" needs to be able to open up to
> 10240 files at once.
> 
> In /etc/security/limits.conf, add the following line:
> 
>    database    hard    nofile   10240
> 
> In /home/database/.bash_profile add the following line:
> 
>    ulimit -n 10240
> 
> Now shutdown and reboot.  Now, whenever "database" logs in, his
> file limit will be 10240.  This assumes that the login shell for
> database is bash.  Of course, if a daemon needs these
> privileges, this won't work, since there is no interactive
> login shell.  You may need to modify the daemon's start-up script
> in this case to add the ulimit command.
> 
> If you want the limit to apply to all users, edit /etc/profile
> instead of ~/.bash_profile.  And in /etc/security/limits.conf,
> substitute an asterisk (*) for the userid "database".  Again,
> this assumes an interactive login shell of bash.  Daemons, since they don't
> have an interactive login shell, won't execute that ulimit
> command.  You'll have to find a place to put it.  The startup
> script in /etc/init.d might be a good place.  But watch for
> upgrades to the startup script which remove the modification.
> If someone else has a better idea for how to implement this,
> let me know.
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> 
> 
> 



Reply to: