Operating System/Linux2010/04/26 20:29

보통 Linux 에서는 Booting 시 Core File을 만들지 않도록 Setting 되어 있지만 설정을 바꾸려면 명령어를 사용해야 합니다.

1. Core Dump 확인 (ulimit –a)

 

2. Dump 용량 설정 (ulimit –c)

 

3. 항상 적용하기 (/etc/security/limits.conf)

위와 같은 명령으로 변경한 것은 해당 User만 변경되어 적용이 되며, reboot 후에는 다시 설정을 하여야 한다. 설정한 항목을 유지하기 위해 ‘/etc/security/limits.conf’를 아래의 형식으로 입력하면 된다.

<domain> <type> <item> <value>

<domain>
해당 설정 값을 적용시킬 범위

       - user name (userid) - 한 유저의 설정 변경
       - group name (@groupid) - 한 그룹에 대한 설정 변경
       - wildcard (*) - 모든 유저, 그룹에 대한 설정 변경
       - wildcard (%) - * 와 동일, 단 maxlogins 변경에만 사용

<type> 

       - hard : superuser와 kernel에 의해 설정이 되게 하며, user는 설정된 값 이상으로 변경이 불가능하다.
       - soft : soft로 설정한 값은 user가 얼마든지 설정 값을 변경 가능하다.
       -    -   : hard와 soft 둘 다 설정

<item> 

       - core : limits the core file size (KB)
       - data : maximum data size (KB)
       - fsize : maximum filesize (KB)
       - memlock : maximum locked-in-memory address space (KB)
       - nofile : maximum number of open files
       - rss : maximum resident set size (KB) (Ignored in Linux 2.4.30 and higher)
       - stack : maximum stack size (KB)
       - cpu : maximum CPU time (minutes)
       - nproc : maximum number of processes
       - as : address space limit
       - maxlogins : maximum number of logins for this user
       - maxsyslogins : maximum number of logins on system
       - priority : the priority to run user process with (negative values boost process priority)
       - locks : maximum locked files (Linux 2.4 and higher)
       - sigpending : maximum number of pending signals (Linux 2.6 and higher)
       - msqueue : maximum memory used by POSIX message queues (bytes) (Linux 2.6 and higher)
       - nice : maximum nice priority allowed to raise to (Linux 2.6.12 and higher)
       - rtprio : maximum realtime priority allowed for non-privileged processes (Linux 2.6.12 and higher) 

예제) core dump file size를 변경 

astrix            -          core          1000
@group1       -          core           unlimited
*                  -          core          200000


이 설정을 하였는데도 불구하고, reboot 시 적용이 안된다면 /etc/profile’을 살펴보자.


# No core files by default
ulimit -S -c 0 > /dev/null 2>&1


위의 빨간 부분을 주석 처리하여 reboot 하여 적용하면 된다.

저작자 표시 비영리 변경 금지
Creative Commons License
Posted by BLUEDAY™