리눅스 core dump 설정
리눅스에서 core dump 는 자동 생성 되지 않는다. 기본 셋팅은 생성 않됨으로 되어 있다.
[root@reyad tmp]# ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
pending signals (-i) 1024
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 18431
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
[root@reyad tmp]#
core file size (blocks, -c) 0 ==> core file size 가 0 인것을 확인 할수 있다.
1. /etc/profile 수정
#vi /etc/profile
At line 26 of the file, replace this line: ulimit -S -c 0 > /dev/null 2>&1
ulimit -S -c 0 > /dev/null 2>&1 ===> ulimit -c unlimited >/dev/null 2>&1
변경
2. /etc/init.d/functions
#vi /etc/init.d/functions
ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0} >/dev/null 2>&1
#ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0} >/dev/null 2>&1 (주석처리)
3. /etc/sysconfig/init
#vi /etc/sysconfig/init
DAEMON_COREFILE_LIMIT=’unlimited’ 추가 ==> 서버에서 실행 되는 모든 데몬에 적용
4. echo 1 > /proc/sys/kernel/suid_dumpable
#echo 1 > /proc/sys/kernel/suid_dumpable 실행
5. /etc/sysctl.conf
#vi /etc/sysctl.conf
kernel.suid_dumpable = 1
kernel.core_uses_pid = 1
kernel.core_pattern=/tmp/core
kernel.core_setuid_ok = 1
#sysctl -p (실행)
6. /etc/security/limits.conf
* – core unlimited (추가)
7. system 재부팅
2 Responses
1exciting
3expressed