Solved

How to setup ulimit to unlimited value for some user id

Posted on 2011-03-11
3
1,690 Views
Last Modified: 2012-05-11

How to setup ulimit to unlimited value for some user id in /etc/security/limits, please provide me exact steps or command line. My system running on IBM AIX 5.3.

Thanks
0
Comment
Question by:sams20
  • 2
3 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 35113053
Hi again,

in /etc/security/limits "unlimited" is expressed as "-1".

Which limit are you talking about?

There are several:

* fsize      - soft file size in blocks
* core       - soft core file size in blocks
* cpu        - soft per process CPU time limit in seconds
* data       - soft data segment size in blocks
* stack      - soft stack segment size in blocks
* rss        - soft real memory usage in blocks
* nofiles    - soft file descriptor limit
* fsize_hard - hard file size in blocks
* core_hard  - hard core file size in blocks
* cpu_hard   - hard per process CPU time limit in seconds
* data_hard  - hard data segment size in blocks
* stack_hard - hard stack segment size in blocks
* rss_hard   - hard real memory usage in blocks
* nofiles_hard - hard file descriptor limit

Basically you have three options to set a limit.

Assuming that you want to set "fsize" to "unlimited" for a userid "myuser" (hard and soft, see below):

1) chsec

chsec -f /etc/security/limits -s myuser -a "fsize_hard=-1" -a "fsize=-1"

2) chuser

chuser "fsize_hard=-1" "fsize=-1" myuser

3) edit /etc/security/limits directly.

Add:

myuser:
        fsize = -1
        fsize_hard = -1


Difference between "hard" and "soft" limits:

Soft limits are ones that the user can move up or down using "ulimit" within the permitted range set by hard limits.

Hard limits are set by the superuser. The user cannot raise his limits above such values.


wmp




0
 

Author Comment

by:sams20
ID: 35113276


Your description is right, but once I setup an unlimited, how I set back to previous limit or ulimit or is it the default one mentioned top of the limits file.

Thanks
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 35113367
Defauts are listed in /etc/security/limits under the "default:" stanza.

These values take effect when there is no explicit setting under the user's stanza.

To set back to default it's sufficient to remove an attribute from the user's stanza.

Removing an attribute is done by setting it to the empty string with chsec or chuser:

chsec -f /etc/security/limits -s myuser -a "fsize_hard=" -a "fsize="

chuser "fsize_hard=" "fsize=" myuser

To reset all limits of a particular user remove the whole stanza including the following attributes up to, but not including the next stanza, if there's any.

Edit /etc/security/limits manually to achieve this, because neither chsec nor chuser can remove a complete stanza.


wmp
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question