[리눅스]Core File 설정
ulimit 설정 변경
현재 ulimit 설정
값
확인
초기
설정에는 core file size가 0으로
설정이
되어있어, core file이
생성이
되지
않는다. /etc/security/limits.conf
<domain>
해당
설정값을
적용시킬
범위 ...
따라서 core dump시 core file이
생성되게
하려면
다음과
같이
설정값을
수정해야
한다.
ulimit 설정
값
변경은
위의
현재
설정값에서
나온
옵션을
써주고
값을
써주면
된다.
위와
같은
명령으로
변경한
것은
해당 user만
변경되어
적용이
되며, reboot 후에는
다시
설정을
해야한다.
위의
설정을 reboot 후에도
유지되게
하기
위해선
아래의
파일
수정이
필요하다.
위
파일에는 ulimit값을
적용할 domain, type, item, value가
들어가게
되어있다.
입력
형식은
다음과
같다.
- 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)
example) core dump file size를
변경
이 설정을 변경 하였는데도 불구하고, reboot 시 적용이 안된다면 /etc/profile 파일을 살펴보자!!
# No core files by default
ulimit -S -c 0 > /dev/null 2>&1
...
위 빨간 글자로 된 부분을 주석처리 해버리고 reboot하면 적용이 잘된다..