1

I'm doing compliance check on SOLARIS 10 OS. I need to verify the following parameter settings:

core file size        (blocks, -c) unlimited
data seg size         (kbytes, -d) unlimited
file size             (blocks, -f) unlimited
open files                    (-n) 65536
stack size            (kbytes, -s) unlimited
cpu time             (seconds, -t) unlimited
virtual memory        (kbytes, -v) unlimited

Sure I could use ulimit -cH to get display above. But I also need to find where those settings are. I'm from Linux, in Linux we have /etc/security/limts.conf file to hold alike information. Do we have such file in Solaris?

TIA!

SQL Warrior
  • 11
  • 1
  • 1
  • 3

3 Answers3

1

Have a look at /etc/system --

  • I've checked /etc/system but seems the parameters are not much at all. If you are pretty sure it's the place to look at, what is the map for the parameters I am looking for: – SQL Warrior Feb 10 '11 at 19:46
  • 1
    /etc/system + projects http://serverfault.com/questions/21417/how-to-set-ulimits-in-solaris-10 – Benoît Feb 10 '11 at 22:02
  • http://download.oracle.com/docs/cd/E19253-01/817-0404/chapter2-1/index.html documents the parameters you can set in /etc/system, including rlim_fd_max & rlim_fd_cur, but not all of the limits are set there. – alanc Feb 12 '11 at 03:12
0

There is no single place where you'll find global settings. They are both per process and dynamic. Any process can lower its own limits and this will be inherited by its child processes. Any process with the PRIV_SYS_RESOURCE privilege can raise hard limits. A notable exception is the open files limit which is set by the rlim_fd_max and rlim_fd_cur variables in /etc/system. All other limits are unlimited by default, except perhaps the stack size.

jlliagre
  • 8,861
  • 18
  • 36
0

You can run "prctl $$" to check the limits of your current process. The "system" ones are the maximum that can be set, a privileged one requires a privileged user to change, and a basic one may be changed by anyone. The one that applies to the current process is the lowest and will be at the top of the list. For example if I do this to change my file descriptors to 100,000:

prctl -t basic -n process.max-file-descriptor -v 100000 $$

Now if I run "prctl $$" again, the privileged value is now at the top because it's the lowest. Even though I changed the basic setting, it cannot give me more resources than the privileged value.

As already has been noted, Solaris is very flexible and dynamic on resource limits, and they can assigned by process, task, project, and zone. You can see which it applies to in the resource name. I don't think there is a Linux equivalent of projects and zones. Tasks are basically equivalent to process groups. Since you're probably running everything in the default configuration and global zone, the prctl command on your current process is probably good enough for what you're asking.

I should also mention the action as that may be import to you. Exceeding a resource can return an error to the code that's asking (deny), send a signal to the process (signal), or do nothing (none) in case you just want to log it but not break anything.

JOTN
  • 1,747
  • 1
  • 10
  • 12