在linux下修改用户的limitation,(和用户的登录Shell相关)

王朝system·作者佚名  2008-05-18
窄屏简体版  字體: |||超大  

在 Linux 下某用户下能否产生 core 文件,产生的 core file size 的等限制,是可以通过修改配置文件

/etc/security/limits.conf 文件里的配置来加以修改。有的时候,系统会在 /etc/profile 之类的文件中

作出全局的配置。例如: 在 SUSE 下的 /etc/profile 经常有如下的缺省设置:

ulimit -Sc 0 # don't create core files

ulimit -Sd $(ulimit -Hd)

ulimit -Ss $(ulimit -Hs)

ulimit -Sm $(ulimit -Hm)

如果希望产生 core,别忘了把这里的设置注释掉。

按照文件前部的说明,可以在文件中添加类似这样的行:

username soft core scorefilesize

username hard core hcorefilesize

@group soft core scorefilesize

@group hard core hcorefilesize

分别对用户'username'和组'groupname'设置能否产生 core,产生的 core file size 的限制

占位符scorefilesize和hcorefilesize需要分别填写

请详细阅读文件 /etc/security/limits.conf 的注释部分

# /etc/security/limits.conf

#

#Each line describes a limit for a user in the form:

#

#Where:

# can be:

# - an user name

# - a group name, with @group syntax

# - the wildcard *, for default entry

# - the wildcard %, can be also used with %group syntax,

# for maxlogin limit

#

# can have the two values:

# - "soft" for enforcing the soft limits

# - "hard" for enforcing hard limits

#

# can be one of the following:

# - core - limits the core file size (KB)

# - data - max data size (KB)

# - fsize - maximum filesize (KB)

# - memlock - max locked-in-memory address space (KB)

# - nofile - max number of open files

# - rss - max resident set size (KB)

# - stack - max stack size (KB)

# - cpu - max CPU time (MIN)

# - nproc - max number of processes

# - as - address space limit

# - maxlogins - max number of logins for this user

# - priority - the priority to run user process with

# - locks - max number of file locks the user can hold

#

#

#

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航