?
Solved

How to setup ulimit to unlimited value for some user id

Posted on 2011-03-11
3
Medium Priority
?
1,833 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
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 how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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