FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 05-19-2010, 03:46 PM
Thomas Koch
 
Default How to set ulimit (nofile) for a daemon

Hi,

HBase needs a high nofile limit. What would be the preferred way to set the
limit for the HBase daemons?

Just call ulimit in the initscript?
The java process is started by "daemon" (Debian package "daemon").

Thank you,

Thomas Koch, http://www.koch.ro


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201005191746.54540.thomas@koch.ro">http://lists.debian.org/201005191746.54540.thomas@koch.ro
 
Old 05-19-2010, 10:20 PM
Felipe Sateler
 
Default How to set ulimit (nofile) for a daemon

On 19/05/10 11:46, Thomas Koch wrote:

Hi,

HBase needs a high nofile limit. What would be the preferred way to set the
limit for the HBase daemons?

Just call ulimit in the initscript?
The java process is started by "daemon" (Debian package "daemon").

Thank you,

Thomas Koch, http://www.koch.ro


Create an exclusive user for your daemon, and drop a file in
/etc/security/limits.d with the following contents:


daemonuser - nofile <somenumber>

You should probably ask via debconf before doing it, though.

-
Saludos,
Felipe Sateler


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: ht1o7k$en1$1@dough.gmane.org">http://lists.debian.org/ht1o7k$en1$1@dough.gmane.org
 
Old 05-19-2010, 10:32 PM
Steve Langasek
 
Default How to set ulimit (nofile) for a daemon

On Wed, May 19, 2010 at 06:20:35PM -0400, Felipe Sateler wrote:
> >HBase needs a high nofile limit. What would be the preferred way to set the
> >limit for the HBase daemons?

> >Just call ulimit in the initscript?
> >The java process is started by "daemon" (Debian package "daemon").

> >Thank you,

> >Thomas Koch, http://www.koch.ro

> Create an exclusive user for your daemon, and drop a file in
> /etc/security/limits.d with the following contents:

> daemonuser - nofile <somenumber>

This is the wrong answer to the question "how do I set ulimits for a daemon
process?" /etc/security/limits.d is only processed by pam_limits, which has
no reason to be in the path for service startup.

> You should probably ask via debconf before doing it, though.

No, you shouldn't do that either.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
 
Old 05-19-2010, 10:51 PM
Felipe Sateler
 
Default How to set ulimit (nofile) for a daemon

On 19/05/10 18:32, Steve Langasek wrote:

On Wed, May 19, 2010 at 06:20:35PM -0400, Felipe Sateler wrote:

HBase needs a high nofile limit. What would be the preferred way to set the
limit for the HBase daemons?



Just call ulimit in the initscript?
The java process is started by "daemon" (Debian package "daemon").



Thank you,



Thomas Koch, http://www.koch.ro



Create an exclusive user for your daemon, and drop a file in
/etc/security/limits.d with the following contents:



daemonuser - nofile<somenumber>


This is the wrong answer to the question "how do I set ulimits for a daemon
process?" /etc/security/limits.d is only processed by pam_limits, which has
no reason to be in the path for service startup.


cron, atd and schroot load pam_limits. Is that wrong? Or something else
I'm not getting?


--
Saludos,
Felipe Sateler


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: ht1q1e$k0l$1@dough.gmane.org">http://lists.debian.org/ht1q1e$k0l$1@dough.gmane.org
 
Old 05-19-2010, 10:58 PM
Steve Langasek
 
Default How to set ulimit (nofile) for a daemon

On Wed, May 19, 2010 at 06:51:25PM -0400, Felipe Sateler wrote:

> >This is the wrong answer to the question "how do I set ulimits for a daemon
> >process?" /etc/security/limits.d is only processed by pam_limits, which has
> >no reason to be in the path for service startup.

> cron, atd and schroot load pam_limits. Is that wrong? Or something
> else I'm not getting?

These daemons load pam_limits *when running on behalf of other users*.
That's an entirely different scenario than running a daemon per se.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
 
Old 05-19-2010, 11:30 PM
Bernd Eckenfels
 
Default How to set ulimit (nofile) for a daemon

In article <20100519225812.GB28995@dario.dodds.net> you wrote:
> These daemons load pam_limits *when running on behalf of other users*.
> That's an entirely different scenario than running a daemon per se.

In the case of a java process started with an init script, it would be su
doing the pam chain typically. For the daemon package I think it is not
using pam sanely. Too bad it does not support setting ulimits directly.

Gruss
Bernd


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201005192330.o4JNUbI3076148@neskaya.eckenfels.net" >http://lists.debian.org/201005192330.o4JNUbI3076148@neskaya.eckenfels.net
 
Old 05-20-2010, 12:13 AM
Russ Allbery
 
Default How to set ulimit (nofile) for a daemon

Thomas Koch <thomas@koch.ro> writes:

> HBase needs a high nofile limit. What would be the preferred way to set
> the limit for the HBase daemons?

> Just call ulimit in the initscript?

That's what I'd do.

--
Russ Allbery (rra@debian.org) <http://www.eyrie.org/~eagle/>


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 87632j1lcw.fsf@windlord.stanford.edu">http://lists.debian.org/87632j1lcw.fsf@windlord.stanford.edu
 
Old 05-20-2010, 12:33 AM
Don Armstrong
 
Default How to set ulimit (nofile) for a daemon

On Wed, 19 May 2010, Russ Allbery wrote:
> Thomas Koch <thomas@koch.ro> writes:
> > HBase needs a high nofile limit. What would be the preferred way to set
> > the limit for the HBase daemons?
>
> > Just call ulimit in the initscript?
>
> That's what I'd do.

I'd suggest having it in /etc/default/hbase (or whatever gets sourced
by the init script) so that it's easily modifiable by the user.

[I'd wonder slightly at why it needs a high nofile, but...]


Don Armstrong

--
With one simple pill
we cured unhappiness
and art
-- a softer world #437
http://www.asofterworld.com/index.php?id=437

http://www.donarmstrong.com http://rzlab.ucr.edu


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100520003354.GD4098@teltox.donarmstrong.com">htt p://lists.debian.org/20100520003354.GD4098@teltox.donarmstrong.com
 
Old 05-20-2010, 12:51 AM
Steve Langasek
 
Default How to set ulimit (nofile) for a daemon

On Thu, May 20, 2010 at 01:30:37AM +0200, Bernd Eckenfels wrote:
> In article <20100519225812.GB28995@dario.dodds.net> you wrote:
> > These daemons load pam_limits *when running on behalf of other users*.
> > That's an entirely different scenario than running a daemon per se.

> In the case of a java process started with an init script, it would be su
> doing the pam chain typically.

*Typically*, you would run the process using start-stop-daemon -u instead of
su, so again ther would be no PAM stack.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek@ubuntu.com vorlon@debian.org
 

Thread Tools




All times are GMT. The time now is 01:15 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org