LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 09-26-2007, 03:48 PM   #1
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Rep: Reputation: 31
how to set ulimits for a specific user with no login shell


Hi!

I have an application, that need additional filedescriptors.

Code:
# ulimit -a
core file size        (blocks, -c) 0
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
max locked memory     (kbytes, -l) unlimited
max memory size       (kbytes, -m) unlimited
open files                    (-n) 1024
pipe size          (512 bytes, -p) 8
stack size            (kbytes, -s) 8192
cpu time             (seconds, -t) unlimited
max user processes            (-u) unlimited
virtual memory        (kbytes, -v) unlimited
As you can see, I have a limit of 1024 descriptors (this is also the hard limit, mind you).

Now, I'd like to increase this value, say, double it.

I can do this with the 'ulimit -n 2048' command, for the current user.

Setting the limit this way, is not global and not permanent.
Changing the setting in /etc/security/limits.conf is not option either, since the user for what I need to change the limit, is a system user with no login shell (/bin/false).

The application is being started from an init script with the start-stop-daemon tool, it changes to the specified user once it's invoked.

How can I change that limit to my needs, when the user under which my application is run, has no login shell?

please help!

--polemon
 
Old 10-11-2007, 03:54 AM   #2
polemon
Member
 
Registered: Jun 2005
Distribution: Fedora 18, Ubuntu 11.10, Ubuntu Server 11.10, DamnSmallLinux 3.4.4, FreeDOS 1.1, OpenBSD 5.0
Posts: 194

Original Poster
Rep: Reputation: 31
I solved it:

When ran from an init script. the 'ulimits -n 2048' command has to be set right before the command that should get those limits.

Even if this is a setuid program, the user as which the command is executed, will hate those ulimits.
 
  


Reply

Tags
descriptors, init, ulimit


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a user login without having a password set? kinetik Linux - General 6 07-25-2009 01:17 PM
where to find .profile or .login for a specific user bopedibop Linux - Newbie 2 07-11-2006 10:23 AM
How to allow specific user to login Vsftp server winxandlinx Linux - Networking 4 05-24-2006 06:47 AM
Menu instead of shell for a specific user in ssh? jon_k Linux - Software 1 05-14-2004 06:04 PM
how to flash a message to a specific user on login mtest Programming 5 10-30-2003 01:36 AM


All times are GMT -5. The time now is 01:49 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration