출처 : 아이네트호스팅


솔라리스 시스템에서 갑작스런 패닉 현상이 나타나게 되면 보통 crash 디렉터리를 지정을
하지 않았다면 /var/crash/[hostname]/ 밑에 unix 파일과 core 파일을 남깁니다..

그 파일을 이용하여 시스템 패닉전에 무슨일이 있었는지 분석이 가능 합니다.

아래는 분석에 사용하는 명령어들과 보기입니다.

우선 core 파일과 unix파일이 있는 디렉터리로 이동 합니다. ( /var/crash/[hostname] )

1. strings

# strings vmcore.0 | grep SunOS ---> OS 의 종류를 보여준다.

# strings vmcore.0 | grep macine ---> 어떤 호스트인지 열거 하여 준다.

# strings vmcore.0 | more ---> 다 보여준다.

2. netstat

# netstat -d unix.0 vmcore.0 --> 네트웍 통계보기

# netstat -n unix.0 vmcore.0 --> NFS통계보기

3. arp

# arp -a unix.0 vmcore.0 --> arp 테이블보기

4. ipcs

# ipcs -a -N unix.0 -C vmcore.0 --> ipc 보기


5. crash

사용법 : crash [ -d dumpfile ] [ -n namelist ] [ -w output-file ]

예)

# crash -d unix.0 vmcore.0
dumpfile = vmcore.0, namelist = /dev/ksyms, outfile = stdout
> status
system name: SunOS
release: 5.7
node name: ns
version: Generic_106541-15
machine name: sun4u
time of crash: 수 11월 7 11:23:10 2001
age of system: 1 hr., 6 min.
panicstr: [AFT1] errID 0x000003a4.70f365cc %sError(s)
See previous message(s) for details
panic registers:
pc: 10010104 sp: 400275d8
> help
help [-w filename] function[s]
help function
alias:
acceptable aliases are uniquely identifiable initial substrings
> help p
p [-e] [-f] [-l] [-w filename] [([-p] [-a] tbl_entry | #procid)... | -r]
tbl_entry = slot number | address | symbol | expression | range
process table
alias: proc
acceptable aliases are uniquely identifiable initial substrings
p -e
PROC TABLE SIZE = 2922
SLOT ST PID PPID PGID SID UID PRI NAME FLAGS
0 t 0 0 0 0 0 96 sched load sys lock
1 s 1 0 0 0 0 58 init load
2 s 2 0 0 0 0 98 pageout load sys lock nowait
3 s 3 0 0 0 0 60 fsflush load sys lock nowait
4 s 347 1 347 347 0 58 sac load jctl
5 s 350 1 350 350 0 37 dmispd load
6 s 138 1 138 138 0 41 keyserv load
7 s 53 1 53 53 0 43 devfseventd load
8 s 57 1 57 57 0 50 devfsadm load
9 s 136 1 136 136 0 58 rpcbind load
10 s 205 1 205 205 0 53 nscd load
11 s 130 1 130 130 60001 58 tocsin load
12 s 188 1 188 188 0 52 syslogd load
13 s 178 1 178 178 0 58 automountd load
14 s 170 1 170 170 0 58 in.named load jctl
15 s 163 1 163 163 0 0 inetd load
16 s 233 228 228 228 1006 23 mshttpd load
17 s 300 267 0 0 0 58 mysqld load
18 s 193 1 193 193 0 49 cron load
19 s 232 228 228 228 1006 33 mshttpd load
20 s 228 1 228 228 0 59 mshttpd load
21 s 234 228 228 228 1006 13 mshttpd load
22 s 235 228 228 228 1006 3 mshttpd load
23 s 236 228 228 228 1006 0 mshttpd load
24 s 249 1 249 249 0 58 utmpd load
25 s 267 1 0 0 0 10 safe_mysqld load
26 s 253 1 253 253 0 58 sendmail load jctl
27 s 265 1 265 265 0 58 httpd load
28 s 10139 265 265 265 60001 58 httpd load
29 s 10146 265 265 265 60001 58 httpd load
30 s 10141 265 265 265 60001 58 httpd load
31 s 10151 265 265 265 60001 58 httpd load
32 s 10140 265 265 265 60001 58 httpd load
33 s 281 1 279 279 0 60 auditd load
36 s 331 1 331 331 0 48 dtlogin load jctl
37 s 325 1 325 325 0 23 mountd load
38 s 327 1 327 327 0 33 nfsd load
40 s 351 347 347 347 0 58 listen load nowait jctl
41 s 348 1 348 348 0 55 ttymon load
42 s 14566 331 14566 14566 0 59 Xsun load
43 s 352 347 347 347 0 58 ttymon load jctl
44 s 10137 265 265 265 60001 53 httpd load
50 s 14585 1 14574 14574 0 59 fbconsole load
55 s 14605 14574 14605 14605 0 59 dtgreet load
60 s 14574 331 14574 14574 0 50 dtlogin load
71 s 10150 265 265 265 60001 58 httpd load
76 s 10138 265 265 265 60001 58 httpd load
82 s 11077 265 265 265 60001 58 httpd load
90 s 11085 265 265 265 60001 58 httpd load
> p -l
p_lock: owner 0 waiters 0
cr_lock: owner 0 waiters 0
Condition variable p_cv: 0
Condition variable p_flag_cv: 0
Condition variable p_lwpexit: 0
Condition variable p_holdlwps: 0
Condition variable p_srwchan_cv: 0
82 s 11077 265 265 265 60001 58 httpd load

p_lock: owner 0 waiters 0
cr_lock: owner 0 waiters 0
Condition variable p_cv: 0
Condition variable p_flag_cv: 0
Condition variable p_lwpexit: 0
Condition variable p_holdlwps: 0
Condition variable p_srwchan_cv: 0
90 s 11085 265 265 265 60001 58 httpd load
.
.
.
. 이하생략..

> q

6. adb 사용하기

# adb -k unix.0 vmcore.0 ( unix파일이나 core파일 대신 커널쪽을 볼수도 있다 ex> adb -k /dev/ksyms /dev/mem )
adb -k unix.0 vmcore.0
physmem 5b01
*panicstr/s ---> 패닉 메세지가 무엇이었나 보여준다.
0x40027768: [AFT1] errID 0x000003a4.70f365cc %sError(s)
See previous message(s) for details
$<utsname ---> 호스트 이름과 장비에 관해 열거해준다.

utsname:
utsname: sys SunOS
utsname+0x101: node ns
utsname+0x202: release 5.7
utsname+0x303: version Generic_106541-15
utsname+0x404: machine sun4u

srpc_domain/s ---> 도메인
srpc_domain:
srpc_domain:

hw_provider/s ---> 제조업체
hw_provider:
hw_provider: Sun_Microsystems

*time-(lbolt%0t100)=Y --->부트시간/날짜
2001 Oct 6 21:26:01

$<msgbuf ---> 최근 메세지 버펄를 열거 하여 준다
SunOS Release 5.7 Version Generic_106541-15 [UNIX(R) System V R
elease 4.0]
0x700b57e0: Copyright (c) 1983-1999, Sun Microsystems, Inc.
0x700b53c3: Ethernet address = 8:0:20:86:23:9e
0x700b4fa0: mem = 196608K (0xc000000)
0x700b4b80: avail mem = 188989440
0x700b4763: root nexus = Sun Ultra 1 SBus (UltraSPARC 167MHz)
0x700b4343: sbus0 at root: UPA 0x1f 0x0 ...
0x70155ee3: sbus0 is /sbus@1f,0
0x70155ac0: dma0 at sbus0: SBus0 slot 0xe offset 0x8400000
0x701556a3: dma0 is /sbus@1f,0/espdma@e,8400000
0x70155280: /sbus@1f,0/espdma@e,8400000/esp@e,8800000 (esp0):
esp-options=0x46
0x70154e60: esp0 at dma0: SBus0 slot 0xe offset 0x8800000 Onboard device spa
rc9 ipl 4
0x70154a43: esp0 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000
0x70154620: NOTICE: Memory scrubber exiting
0x70154200: sd0 at esp0:
0x70177d40: target 0 lun 0
0x70177923: sd0 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0
0x70177500: <FUJITSU-MAB3091SC-2703 cyl 7185 alt 2 hd 10 sec 248>
0x701770e0: sd1 at esp0:
0x70176cc0: target 1 lun 0
0x701768a3: sd1 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0
0x70176480: <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
0x70176060: sd4 at esp0:
0x70179c00: target 4 lun 0
0x701797e3: sd4 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@4,0
0x701793c0: <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>
0x70178fa0: sd6 at esp0:
0x70178b80: target 6 lun 0
0x70178763: sd6 is /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@6,0
0x70178347: root on /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0:a fstyp
e ufs
0x700efee0: zs0 at sbus0: SBus0 slot 0xf offset 0x1100000 Onboard device spa
rc9 ipl 12
0x700efac3: zs0 is /sbus@1f,0/zs@f,1100000
0x700ef6a0: zs1 at sbus0: SBus0 slot 0xf offset 0x1000000 Onboard device spa
rc9 ipl 12
0x700ef283: zs1 is /sbus@1f,0/zs@f,1000000
0x700eee66: keyboard is </sbus@1f,0/zs@f,1000000> major <29> minor <2>
0x700eea46: mouse is </sbus@1f,0/zs@f,1000000:b> major <29> minor <3>
0x700ee626: stdin is </sbus@1f,0/zs@f,1000000> major <29> minor <2>
0x700ee200: cgsix0 at sbus0: SBus0 slot 0x1 offset 0x0 SBus level 5 sparc9 i
pl 9
0x7015fea3: cgsix0 is /sbus@1f,0/cgsix@1,0
0x7015fbe1: cgsix0: screen 1152x900, single buffered, 1M mappable, rev 11
0x7015f926: stdout is </sbus@1f,0/cgsix@1,0> major <39> minor <0>
0x7015f660: cpu0: SUNW,UltraSPARC (upaid 0 impl 0x10 ver 0x22 clock 167 MHz)
0x7015f3a0: ledma0 at sbus0: SBus0 slot 0xe offset 0x8400010
0x7015f0e0: le0 at ledma0: SBus0 slot 0xe offset 0x8c00000 Onboard device sp
arc9 ipl 6
0x7015ee23: le0 is /sbus@1f,0/ledma@e,8400010/le@e,8c00000
0x7015eb63: dump on /dev/dsk/c0t0d0s1 size 1000 MB
0x7015e8a2: pseudo-device: devinfo0
0x7015e5e3: devinfo0 is /pseudo/devinfo@0
0x7015e320: fd0 at sbus0: SBus0 slot 0xf offset 0x1400000 Onboard device spa
rc9 ipl 11
0x7015e063: fd0 is /sbus@1f,0/SUNW,fdtwo@f,1400000
0x70559d60: sbusmem0 at sbus0: SBus0 slot 0x0 offset 0x0
0x70559aa3: sbusmem0 is /sbus@1f,0/sbusmem@0,0
0x705597e0: sbusmem1 at sbus0: SBus0 slot 0x1 offset 0x0
0x70559523: sbusmem1 is /sbus@1f,0/sbusmem@1,0
0x70559260: sbusmem2 at sbus0: SBus0 slot 0x2 offset 0x0
0x70558fa3: sbusmem2 is /sbus@1f,0/sbusmem@2,0
0x70558ce0: sbusmem3 at sbus0: SBus0 slot 0x3 offset 0x0
0x70558a23: sbusmem3 is /sbus@1f,0/sbusmem@3,0
0x7042b70b: WARNING: [AFT1] EDP event on CPU0 Data access at TL=0, errID 0x0
00003a4.70f365cc
AFSR 0x00000000.80400002<PRIV,EDP> AFAR 0xffffffff.ffffffff
AFSR.PSYND 0x0002(Score 95) AFSR.ETS 0x00 Fault_PC 0x1018af18
UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000 UDBL.ESYND 0x00
0x7055834b: [AFT2] errID 0x000003a4.70f365cc No error found in ecache (No fa
ult PA available)
0x70558080: panic[cpu0]/thread=40027e60:
0x70558b80: [AFT1] errID 0x000003a4.70f365cc EDP Error(s)
See previous message(s) for details
0x70154fc0:
0x7015f7c3: syncing file systems...
0x7015fd43: [4]
0x7015f243: [4]
0x7015f500: panic[cpu0]/thread=4003fe60:
0x700ef800: panic sync timeout
0x7015ea00:
0x700efc23: dumping to /dev/dsk/c0t0d0s1, offset 209780736

$c ---> C 스택 역추적
complete_panic(0xf,0x10437c00,0x40027e60,0x7011478a,0x0,0x10107880) + 24
do_panic(0x1,0x40027954,0x10107f70,0x0,0x0,0x400277bb) + 174
vcmn_err(0x3,0x40027768,0x40027954,0x7efefeff,0x81010100,0xff00) + 14
cpu_aflt_log(0x400278f8,0x400277bb,0x40027978,0x3,0x1010785c,0x10107880) + 4c0

rootfs$<bootobj ---> 루투장치는 어떤것인가

rootfs:
rootfs: fstype ufs^@^@^@^@^@^@^@^@^@^@^@^@^@
rootfs+0x10: name /sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0:a^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@
rootfs+0x90: flags size vp
0 0 0

swapfile$<bootobj ---> 스왑장치는 어떤것인지 열거

swapfile:
swapfile: fstype ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
swapfile+0x10: name ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@
^@^@^@^@
swapfile+0x90: flags size vp
0 0 0

$q ---> 종료


=========================================================================================================================================

자동분석 스크립트입니다.


사용방법은

#/var/crash/[hostname]/
안에 위의 파일을 넣어놓습니다.  만약 갑자기 reboot 되거나 하면 dumpadm.conf 및 coreadm.conf 를 건드리지 않는한 위의 경로에 unix.0 vmcore.0 등의 파일이 생기게 됩니다.
"hostname" 이 Server name 이라는건 아시겠죠?

그다음  #/var/crash/[hostname]/iscda unix.0 vmcore.0 >> /log/iscda.txt

이렇게 하시고

#vi /log/iscda.txt 파일을 보시면 됩니다.

[스크랩] Crash Dump & Core File

Posted 2009. 1. 23. 17:37

출처: http://blog.naver.com/tangamjaelt?Redirect=Log&logNo=43605204

###################################################################################################

# source site : blog.naver.com/tangamjaelt

#   master : 강용운

#   email : tangamjaelt@korea.com

#   last release : 2007.10.29

###################################################################################################

 

crash dump : 시스템에 치명적인 오류가 발생하였을 경우 생성

core file : 각각의 프로세스에 오류가 발생하였을 경우 생성

 

 

1. crash dump

 

- OS에 치명적인 에러가 발생하게 되면, OS는 콘솔에 해당 메시지를 보여주며, 메모리에 있는 내용을 미리 지정한 dump device 에 crash dump를 생성하고 reboot 한다.

- dump device 는 local disk 의 swap 파티션이다.

- dump contents 는 메모리에 있는 kernel memory page 로 구성된다.

- Solaris kernel 이 데이터 무결성에 대한 문제나, H/W fault 를 만나게 되면 panic 루틴이 수행된다.

- System panic 은 메모리 정보를 dump device 에 복사하는 이벤트이다.

- crash dump 를 통해 치명적 에러에 대한 원인을 분석할 수 있다.

- dumpadm 명령을 사용하여 dump device를 구성한다.

 

- dump 시 savecore 명령이 부팅할동안 자동 실행된다.

- savecore 명령은 dump device 로부터 crash dump 를 다시 가져오는 역할을 하며, 가져온 crash dump 를 파일시스템에 쓴다.

- savecore 명령은

   - /var/crash/hostname/vmcore.X(덤프식별번호) 파일에 kernel core 정보를 둔다.

   - /var/crash/hostnmae/unix.X 파일에 namelist 와 symbol table 정보를 둔다.

 

- crash dump 디렉토리 내에 bounds 파일이 생성된다.

- bounds 파일은 다음에 저장될 dump의 앞번호를 가지고 있다.

- dumpadm 명령을 통해 dump device를 설정하고, savecore 의 디렉토리 위치를 설정한다.

dumpadm - configure operating system crash dump

# dumpadm

 

사용자 삽입 이미지








 

- Savecore enabled: yes 는 부팅 시 자동으로 savecore 명령이 구동되게 하는 설정이다.

# cat /etc/dumpadm.conf

 

사용자 삽입 이미지














 

- dumpadm 설정 파일이나 직정 수정하지 않고, dumpadm 명령을 사용하여 변경하도록 한다.

dumpadm 옵션

-y : yes. 부팅 시 savecore 명령 실행.

-n : no. 부팅 시 savecore 명령 실행 안함.

-u : update. kernel의 dump 구성을 강제적으로 /etc/dumpadm.conf 파일을 내용으로 업데이트.

-d : dump-device. 절대경로 또는 swap.

-c : contents-type. kernel, all, curproc 중 하나 선택 (curproc = kernel memory page + 현재 실행중인 프로세스의 memory page)

-r : root-dir. 기본적으로 (/)로 지정됨.

-s : savecore-dir. savecore 명령 실행 시 생성되는 파일의 디렉토리 지정. 기본적으로 /var/crash/hostname

-m : 현재 savecore-dir 에 minfree 파일을 생성.

 

 



2. core file

 

- 프로세스가 비정상적으로 종료되었을 경우 core 파일이 생성된다.

- core 파일은 프로세스에 문제가 생길 당시에 프로세스에 할당된 메모리의 snapshot 이다. (RAM → Disk)

- core 파일은 프로세스의 문제점을 분석을 하는데 사용한다.

- coreadm 명령을 사용하여 core파일의 위치와 이름을 설정한다.

 

core 파일의 종류

- global core file : mode 600 으로 생성되고, superuser 가 소유한다.

- per-process core file : mode 600 으로 생성되고, 프로세스 구동 user 가 소유한다.

 

coreadm - core file administration

 

# coreadm

 

사용자 삽입 이미지















global core file pattern :
/var/core/core.%f.%p.%u (global core 파일의 생성 위치 및 core 파일의 생성 이름 설정)

init core file pattern : core (프로세스 별로 사용하게 될 core 파일의 이름 설정)

global core dumps : disabled (global core 파일 생성 안함)

per-process core dumps : enabled (per-process core 파일 생성함)

global setid core dumps : disabled (setUID, setGID 권한으로 실행 된 프로세스에 대한 global core 파일 생성 안함)

per-process setid core dumps : disabled (setUID, setGID 권한으로 실행 된 프로세스에 대한 per-process core 파일 생성 안함)

global core dump logging : disabled (로그 안남김)

# /etc/coreadm.conf

 

사용자 삽입 이미지


















- 직접 수정하지 말고 coreadm 명령을 사용함.

- coreadm 실행 시 나타내는 항목과 같음.

coreadm 옵션

-i 패턴 : core 파일의 경로와 이름 설정  

-e 옵션 : enabled. 옵션은 global, process, global-setid, proc-setid, log 중 하나.

-d 옵션 : disabled.

-u : /etc/coreadm.conf 파일을 강제로 업데이트.

-g 패턴 : global core 파일의 경로와 이름 설정

-p 패턴 : per-process core 파일의 경로와 이름 설정

 

패턴 옵션

%p : PID

%u : effective UID

%g : effective GID

%f : 실행 파일 이름

%n : hostname (uname -n)

%m : machine name (uname -m)

%t : 시간

%% : 문자열


# coreadm -e process enable

# coreadm -g /var/core/core.%f.%p -e global

# coreadm -p $HOME/corefiles/%n.%f.%p $$ -e process ($$는 현재 PID)

# coreadm 278 3483  (특정 PID를 가지는 프로세스에 대한 core file 구성 체크)

 

사용자 삽입 이미지













# cat /etc/coreadm.conf

 

사용자 삽입 이미지












 

- file 명령으로 프로세스를 확인할 수 있다.

 

사용자 삽입 이미지

















[스크랩] CPU 와 Memory Error...

Posted 2009. 1. 22. 20:29

[출처] [펌]Solaris CPU와 메모리 이벤트 관련|작성자 대충쏜다



Solaris device간 통신을 할 경우 data의 정합성을 보장하기 위해

Data 전송 시 parity 값을 같이 전송하며 만약 data를 받을 때 정합성에

문제가 있을 경우 parity를 이용해 data를 보정한다.

 

일반적인 반도체 소자의 경우 일정량의 전자파 방출이 있으며 특정 환경에서(온도,습도 비적정 및 다른장비 에서 발생되는 전자파의 간섭이 있을경우)

전자파 방출량이 많아지게 되는 현상이 발생하면서 bit 오류를 발생 시키는 경우가 있다.

 

위에서 처럼 parity data를 보정 가능할 경우를 CE(correctable Error)라 하며

word double bit오류가 발생하여 data 보정이 불가능 할 경우를 UE(Uncorrectable Error)

하며 UE의 경우 hardware error로 간주하여 해당 part를 교체 해야한다.

 

다는 vendor의 제품들과 같이 Sun system memory의 경우 ECC(Error check & correct) 기능이

있는 memory를 사용하며 CPU scrubber 기능을 두어 CE UE error control한다.

 

CE error error fix한후 messages에 정상적으로 device가 동작했음을 알려주는

notice를 나타내며 UE의 경우 hardware error로 해당 device down시키거나 system reset

가해 지게 된다.

 

그러나 CE error가 동일 part에 대해서 계속적으로 발생할 경우는 hardware적인 오류가 있을수

있으므로 해당 part를 교체해 주어야 한다.

 

 

 

3.Messages file 분석법

 

 

1) Memory CE Error관련(eprjdb2 분석)

May 22 11:09:50 eprjdb2 SUNW,UltraSPARC-II: [ID 362078 kern.info] [AFT0] Corrected Memory Error

 detected by CPU11, errID 0x001dd49c.d54e5a7b

May 22 11:09:50 eprjdb2 SUNW,UltraSPARC-II: [ID 589262 kern.info] [AFT0] errID 0x001dd49c.d54e5

a7b Corrected Memory Error on Board 5 J3101 is Persistent

 

CE error의 경우 위의 sample에서 처럼 다음과 같은 3가지 type message display된다.
 
"Intermittent"  : data에 오류가 있어 다시 해당 word read할시 error가 없는 경우로
memory module 교체는 필요 없다.
 
"Persistent"   : data에 오류가 있어 다시 해당 word read할시 또 오류가 있는 경우로
memory scrub operation으로 해당 bit fix를 수정한 경우로
 module에서 계속적인 error(24시간내 4번 이상) 없을 경우 memory 교체는
 필요 없다.
 "Sticky"-     persistent error bit를 수정한 이후에도 error fix되지 않는 경우로 
 error가 발생하면 즉시 memory를 교체해 주어야 한다.
 

eprjdb2의 경우는 persistent로 만약 24시간내 동일 장애가 4회 이상 발생하지 않을시

memory교체는 필요 없으며 추후 동일 장애가 발생하는지 monitoring이 필요하다.

 

 

 

2) CPU CE error 관련(zoisite 분석)

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 359263 kern.info] [AFT2] E$Data (0x20):

 0x00000000.00000000

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 359263 kern.info] [AFT2] E$Data (0x30):

 0x00000000.00000000

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 522370 kern.info] NOTICE: [AFT2] errID

0x00048964.88b46551 CBI event on CPU15

May 24 04:01:38 zoisite SUNW,UltraSPARC-II: [ID 147036 kern.info] [AFT2] errID 0x000489

64.88b46551 PA=0x00000000.007bd600

 

 

Memory의 경우 12시간에 최소 한번 이상의 scrubber가 동작하여 모든 memory scan하여

정합성 여부를 test하나 CPU memory bit점검과 비슷한 방식으로 정합성 test는 하지만

초당 최소 한번 이상의 scrubber가 동작 하면서 Ecache memory를 점검한다.

이경우 single bit오류가 발생했을시 다음과 같은 CBI/CBB/DBI/DBB형태로 message

표출하며 만약 double bit오류가 발생할 시에는 UE error로 시스템이 reset되게 된다.

 

clean_bad_idle : CBI event  à해당 data를 사용치 않으나 bad로 판명되어 re-read error
                             없는 경우
clean_bad_busy : CBB event à해당 data를 사용하지만 bad로 판명되어 re-read error 없는경우
dirty_bad_idle : DBI event à해당 data를 사용치 않으나 bad로 판명되어 bit 수정

dirty_bad_busy : DBB event à 해당 data를 사용하지만 bad로 판명되어 bit 수정

 
위의 zoisite 경우 cpu 15번의 CBI event ecach bit 오류가 있었으나 re-read 
error가 없는 경우로 이는 단순 scrubber가 정상적으로 동작 했음을 나타내는 message
cpu 교체는 필요 없다.
 

3) CPU UE error 관련

WARNING: [AFT1] EDP event on CPU1 Instruction access at TL=0, errID

0x0000ad88.6cd9989f

         AFSR 0x00000000.80408000<PRIV,EDP> AFAR 0x00000000.0f0c8080

         AFSR.PSYND 0x8000(Score 95) AFSR.ETS 0x00 FAULT_PC 0x780b481c

         UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000 UDBL.ESYND 0x00

 

CPU UE error는 다음과 같은 방식으로 display 되며

message display될 경우는 해당 cpu를 교체 해야 한다.

 

EDP(Ecache Data Parity Event)

  CPU Ecache Data SRAM(cpu 상에 있는 cache memory 이름)

으로부터 Data Reading할시 parity error가 발생한경우 발생

 

WP(Write Back Data Parity Error)

  CPU Ecache로부터 main memorydata written back될시에

  Cpu상의 UDB(Ultra Data Buffer) chip에서 parity error를 발생할시

 

CP(Copy Out Data Parity Error)

  특정 cpu로부터 다른 cpu ecache data copy할시 parity error 발생

 

 

-CPU관련 error messages설명

 

Cpu error발생시 시스템 console이나 /var/adm/messages ,core file등에

다음과 같은 message가 출력되며 type별로 설명하면 다음과 같다.

 

 

Category 1: Messages that identify the type and source of an error

 ------------------------------------------------------------------

 

       WARNING: [AFT1] EDP event on CPU1 Instruction access at TL=0, errID

0x0000ad88.6cd9989f

         AFSR 0x00000000.80408000<PRIV,EDP> AFAR 0x00000000.0f0c8080

         AFSR.PSYND 0x8000(Score 95) AFSR.ETS 0x00 FAULT_PC 0x780b481c

         UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000 UDBL.ESYND 0x00

 

       [Score 95] data parity error가 발생할시 Error 원인을 제공한 cpu는 확률방식으로

                checking하게 되며 50이상으로 표시되는cpu fault임을 뜻한다.

                위의 sample의 경우 score 95인 경우이므로 cpu1 hardware 오류가

                있음을 뜻한다.

 

 

Category 2: Messages that supply a cache line or memory dump

   ------------------------------------------------------------

     [AFT2] errID 0x0000ad88.6cd9989f PA 0x00000000.0f0c8080 E$tag

0x00000000.0bc001e1 E$State: Modified E$parity 0x05

      [AFT2] E$Data (0x00): 0xffffffff.beefface *Bad* PSYND=0x8000

      [AFT2] E$Data (0x08): 0x00000000.00000000

      [AFT2] E$Data (0x10): 0x6d656d6d.6f727920

      [AFT2] E$Data (0x18): 0x6572726f.7220696e

      [AFT2] E$Data (0x20): 0x6a656374.6f720000

      [AFT2] E$Data (0x28): 0x6d656d74.65737420

      [AFT2] E$Data (0x30): 0x6d757465.780059f8

      [AFT2] E$Data (0x38): 0x00000300.00c11000

      [AFT2] Event PA displayed in AFAR was derived from E$Tag

 

      [AFT2] 추후 분석을 위한 cache memory,main memory dump를 뜻하는 표시어

 

Category 3: Messages from the kernel error recovery code

   --------------------------------------------------------

      [AFT3] errID 0x00000058.0d0dc830 Above Error detected by protected Kernel code

          that will try to clear error from system

 

      [AFT3] error발생시 kernel상에서 detect code display하는 표시어

 



Solaris 서버정보 확인 명령어

1. 솔라리스 버전 및 업데이트 번호
[SOLARIS:/]cat /etc/release
                     Solaris 8 HW 7/03 s28s_hw3wos_05a SPARC
           Copyright 2003 Sun Microsystems, Inc.  All Rights Reserved.
                             Assembled 11 June 2003


2. 서버의 모델 출력
[SOLARIS:/]prtconf -vp | grep banner-name
    banner-name:  'Sun Fire V240'


3. 서버 정보
[SOLARIS:/]uname -a
SunOS SOLARIS 5.8 Generic_108528-22 sun4u sparc SUNW,Sun-Fire-V240
   ⓐ          ⓑ      ⓒ             ⓓ               ⓔ       ⓕ      ⓖ            ⓗ
ⓐ System(OS)
ⓑ Hostname
ⓒ Release
ⓓ Kernel Version(ID)
ⓔ Kernel architecture(그외 i86pc, sun4m, sun4c 등)
ⓕ Application architecture(그외 sparc, i386, i686등
ⓖ Maker?
ⓗ Banner

-a 옵션이 아닌 -X 옵션으로 좀더 쉽게 볼 수 있으며 비슷한 명령어로는 showrev명령어가 있습니다.

[SOLARIS:/]showrev
Hostname: SOLARIS
Hostid: 838e1e19
Release: 5.8
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.8 Generic 108528-22 May 2003

일반적으로 uname -v 명령어를 통해 설치된 Kernel에 적용된 최신 패치를 보여 주며
uname -srv 명령어를 통해 OS와 Kernel을 같이 본다. 하지만 좀더 자세한 정보를 원한다면
showrev -p 명영어를 통해 좀더 자세한 정보를 확인할 수 있습니다.

[SOLARIS:/]showrev -p | more
Patch: 109879-02 Obsoletes: 109654-02 Requires: 109877-01 Incompatibles:  Packages: SUNWcarx, SUNWcsr

패치가 많이 이루어 졌다면 상당량의 라인이 지나갈 것입니다. 때문에 more명령을 같이 넣어주면 확인하는대 불편함이 없을 것입니다.
Patch: 109879-02는 이 패치로 인해 109654-02 패치가 쓸모없어 제거 됬으며, 이 패치를 설치하기 위한 선행 패치로 109877-01이 설치되어야 하며, 관련 패키지는 SUNWcarx와 SUNWcsr이 있다는 것을 의미 한다.


4. 장착(monut)된 Disk(갯수) 확인
[SOLARIS:/]iostat -nE
c1t0d0          Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: FUJITSU  Product: MAP3367N SUN36G  Revision: 0401 Serial No: 00N0BPPN    
Size: 36.42GB <36418595328 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0
>>
c1t1d0          Soft Errors: 0 Hard Errors: 0 Transport Errors: 0
Vendor: SEAGATE  Product: ST336607LSUN36G  Revision: 0307 Serial No: 3JA65ZTV00007349
Size: 36.42GB <36418595328 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

보기 쉽게 중간에 공백을 넣어 놓았습니다. 실제로 명령어를 입력했을때
는 공백이 존재하지 않습니다.

c1t0d0(FUJITSU)와 c1t1d0(SEAGATE) Disk, 이렇게 두게의 Disk가 보입니다.
df -k 명령어로 용량을 확인해 봐도 Filesystem부분에

[SOLARIS:/]df -k
Filesystem                  kbytes      used      avail capacity  Mounted on
/dev/dsk/c1t0d0s0      1016122    222789    732366    24%    /
/dev/dsk/c1t0d0s4      1016122    719173   235982    76%     /usr
/dev/dsk/c1t0d0s1       492872    173737    269848    40%    /var
/dev/dsk/c1t0d0s6    30879855     91478 30479579      1%    /backup
/dev/dsk/c1t0d0s5       492872    175590    267995    40%    /tmp
/dev/dsk/c1t1d0s6    35009161 30749312  3909758     89%    /home1

총 6개의 파티션으로 나뉜 두게의 Disk가 보입니다.
/dev/dsk/c1t0d0s[04165], /dev/dsk/c1t1d0s6

※ 참고
솔라리스는 장착된 디스크에 대한 물리적인 정보를 ‘devices.....’라는 디렉토리에 보관한 후 솔라리스가 실제 사용하는 이름으로 링크하는데 앞의 예제가 바로 그것이다. 이때 솔라리스는 물리적인 디스크에 대한 사용 방식을 두가지로 정의한다. 디스크를 있는 그대로 사용하기 위한(raw device) 방법으로 ‘/dev/rdsk/...’에 링크를 저장하는 방법과, 디스크를 솔라리스의 파일 시스템용으로 사용하기 위해 별도의 링크를 ‘/dev/dsk/...’ 디렉토리에 저장하는 방법이 있다.
일반적으로 오라클과 같은 데이터베이스나 특정 애플리케이션은 파일 시스템과 관련없이 로 디바이스(raw device)를 사용하기 때문에 ‘/dev/rdsk/....’ 밑의 파일을 사용한다. 한편 솔라리스가 직접 제어하는 파일 시스템은 블럭 디바이스(block device)를 사용하며 ‘/dev/dsk/....’ 밑의 디스크 링크를 사용한다.
따라서 어느 쪽이나 사용자가 앞의 예제와 같이 ls 명령을 실행하면 솔라리스가 인지한 디스크의 정보를 얻을 수 있다. 앞의 예제에서 표시된 내용을 해석해보면 세개의 디스크 컨트롤러(c0,c1,c2)가 장착돼 있으며, 0번 컨트롤러에는 t1 디스크 하나, 1번 컨트롤러에는 t6 디스크 하나, 2번 컨트롤러에는 t10과 t11이라는 두개의 디스크가 연결돼, 총 4개의 디스크가 시스템에 장착돼 있다는 것을 알 수 있다.

참고 사이트 : http://blog.naver.com/wooya510?Redirect=Log&logNo=60008927738


5. CPU 구성 확인
[SOLARIS:/]psrinfo -v 또는
[SOLARIS:/]/usr/sbin/psrinfo -v
Status of processor 0 as of: 11/07/08 14:46:54
  Processor has been on-line since 10/15/08 21:30:42.
  The sparcv9 processor operates at 1002 MHz,
        and has a sparcv9 floating point processor.

한개의 SPARCV9 1002MHz짜리 CPU가 있음을 보여주고 있습니다.
만약 여러게 였다면 위와 같은 정보가 여러번 나오게 됩니다.
때문에 한번에 갯수만 출력하는 명령어를 친다면 다음과 같이 입력하면 됩니다.

[SOLARIS:/]psrinfo -v | grep "Status of processor" | wc -l      
       1


6. Memory Size보기
[SOLARIS:/]prtconf | grep "Memory"
Memory size: 512 Megabytes


7. CPU점유율 확인
[SOLARIS:/]prstat
   PID USERNAME    SIZE   RSS STATE  PRI NICE   TIME CPU  PROCESS/NLWP
   296            root    443M  258M   sleep   59  -20   3:00.02   5.4%        SOLARIS/17
   311            root   3464K 1600K    sleep  58    0    0:22.13   0.1%        SOLARIS/1
    70            root    3920K 2440K   sleep   31    0   0:00.00   0.1%         picld/6
  3227    SOLARIS   1584K 1216K    cpu0   58    0   0:00.00   0.0%          prstat/1
 19074   SOLARIS   6688K 2016K       run   58    0   0:00.00   0.0%         sshd/1
 27216   SOLARIS   2560K 1784K   sleep    48    0   0:00.00   0.0%         bash/1
 27211          root    6696K 2712K   sleep   38    0   0:00.00   0.0%          sshd/1
 27245          root    2560K 1784K   sleep   58    0   0:00.00   0.0%          bash/1
 19072          root    6696K 2760K   sleep   22    0   0:00.00   0.0%          sshd/1
   272           root    5272K 1328K   sleep   20    0   0:00.00   0.0%          dtlogin/4
   310           root    1840K  632K   sleep   58    0   0:00.00   0.0%          ttymon/1
   210           root    3680K 1112K   sleep   58    0   0:00.00   0.0%         vold/5
   186           root    1048K  512K   sleep   58    0   0:00.03   0.0%          utmpd/1
   163           root    2064K  968K   sleep   48    0   0:01.35   0.0%          cron/1
   159           root    4088K 1592K   sleep  59    0   0:00.00   0.0%           syslogd/11
   152           root    1824K  440K   sleep   50    0   0:00.00   0.0%          inetd/1
 19076   SOLARIS   2560K 1792K      run   48    0   0:00.00   0.0%          bash/1
   130           root    2240K  272K   sleep    5    0   0:00.00   0.0%          rpcbind/1
   178           root    4056K 1280K   sleep    0    0   0:00.06   0.0%          sshd/1
    59            root   1752K  712K   sleep   30    0   0:00.00   0.0%          syseventd/12
 27214   SOLARIS   6688K 2008K   sleep   58    0   0:00.00   0.0%         sshd/1
    68            root   2760K  920K   sleep   53    0   0:00.00   0.0%         devfsadm/7
  2790           root   9776K 8240K   sleep    0    0   0:00.06   0.0%          nvfs/1
   308           root    1864K  520K   sleep   38    0   0:00.00   0.0%         ttymon/1
   307           root    1832K  528K   sleep   59    0   0:00.00   0.0%         sac/1
     1            root     840K  264K   sleep   58    0   0:00.43   0.0%         init/1
 

Total: 26 processes, 108 lwps, load averages: 0.06, 0.10, 0.12

하지만 이렇게 입력하면 한번 출력하고 끝이기 때문에 다음과 같이 입력 합니다.

[SOLARIS:/]prstat 5 5

이렇게 입력하면 prstat 명령여를 5초에 한번씩 5번 친 효과가 나타 납니다.
즉, 5초 간격으로 총 5번 자동적으로 prstat값이 reflash됩니다.


8. 시스템 장치의 정보 확인
[SOLARIS:/]uname -i
SUNW,Sun-Fire-V240
   ⓐ             ⓑ
Maker       Banner
이를 이용해 시스템 장치의 정보를 확인 할 수 있다.

[SOLARIS:/]/usr/platform/`uname -i`/sbin/prtdiag | more
System Configuration: Sun Microsystems  sun4u Sun Fire V240
System clock frequency: 167 MHZ
Memory size: 512MB     
==================================== CPUs ====================================
                      E$          CPU     CPU       Temperature         Fan
       CPU  Freq      Size        Impl.   Mask     Die    Ambient   Speed   Unit
       ---  --------  ----------  ------  ----  --------  --------  -----   ----
     MB/P0  1002 MHz  1MB         US-IIIi  2.4       -        -   
================================= IO Devices =================================
     Bus   Freq
Brd  Type  MHz   Slot        Name                          Model
---  ----  ----  ----------  ----------------------------  --------------------
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    33           MB  isa/su (serial)                                 
 0   pci    33           MB  isa/su (serial)                                 
 0   pci    33           MB  pci10b9,5229 (ide)                              
 0   pci    66           MB  scsi-pci1000,21 (scsi-2)                        
 0   pci    66           MB  scsi-pci1000,21 (scsi-2)                        
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    66           MB  pci108e,1648 (network)                          
 0   pci    33            7  isa/rmc-comm-rmc_comm (seria+                   
============================ Memory Configuration ============================
Segment Table:
-----------------------------------------------------------------------
Base Address       Size       Interleave Factor  Contains
-----------------------------------------------------------------------
0x0                512MB             1           BankIDs 0
Bank Table:
-----------------------------------------------------------
           Physical Location
ID       ControllerID  GroupID   Size       Interleave Way
-----------------------------------------------------------
0        0             0         512MB           0
Memory Module Groups:
--------------------------------------------------
ControllerID   GroupID  Labels
--------------------------------------------------
0              0        MB/P0/B0/D0,MB/P0/B0/D1
=============================== usb Devices ===============================
Name          Port#
------------  -----
keyboard        2
======== FRU Status =========
-------------------------
Fru Operational Status:
-------------------------
Location        Status  
-------------------------
MB/SC           okay
PS0             okay
HDD0            present
HDD1            present
 

 



Solaris 에서 일반 사용자로  login 후 Root로 권한을 획득을 하면 로그가 남지만 Root 로 login후 일반 사용자로 전환을 하게 되면 사용자 로그가 남지 않게 됩니다.

이를 방지하기 위해 Root 로 Telnet 원격 접속을 막아놓는게 보안상 효율적입니다.

먼저 vi 를 이용하여 수정하도록 하겠습니다.

# vi /etc/default/login

# ident "@(#)login.dfl  1.13    03/01/10 SMI"
#
# Copyright 1989-2002 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

# Set the TZ environment variable of the shell.
#
#TIMEZONE=EST5EDT

# ULIMIT sets the file size limit for the login.  Units are disk blocks.
# The default of zero means no limit.
#
#ULIMIT=0

# If CONSOLE is set, root can only login on that device.
# Comment this line out to allow remote login by root.
#
CONSOLE=/dev/console


여기서 위에 있는 CONSOLE=/dev/console 이 부분을 주석 처리하게 되면 Root 로 telnet 로그인이 가능합니다.

주석을 달게 되면 Root 로 telnet 로그인이 안되구요.

마지막으로  꼭~ inetd 를 재시작 하시는건 아시죠?  제가 작성한 글중 ProFTP 설치 부분을 보시면 아실껍니다.

그래도 일단 다시 한번 적을께요.

#ps -ef | grep inetd

    root 14383     1  0 09:55:09 ?        0:00 /usr/sbin/inetd -s

꼭~ PID를 확인

#kill -HUP 14383 를 하시면 됩니다.


Solaris 혹은 Linux 에서 파일이 지워지지 않을때 정말 당황스럽습니다.

제가 조금 알아봐 본 방법을 적어 놓도록 하겠습니다.

일단 밑을 보시면 맨밑에 q 라는 파일은 있습니다.

# ls -al
총 42
drwxr-xr-x  20 root     other        512 12월 24일  14:30 .
drwxr-xr-x  40 root     sys         1024 2008년  5월 21일 ..
drwxr-xr-x   7 root     bin          512 2008년  5월 21일 BerkeleyDB.4.2
drwxr-xr-x  13 root     other        512 2008년  5월 21일 apache
drwxr-xr-x  12 root     other        512 2008년  5월 21일 apache.org
drwxr-xr-x   2 root     bin         2048 12월 23일  09:34 bin
drwxr-xr-x  17 root     bin          512 12월 23일  09:34 doc
drwxr-xr-x   2 root     bin          512 12월 23일  09:34 etc
drwxr-xr-x   5 root     other        512 2008년  5월 21일 gd
drwxr-xr-x  10 root     bin         1024 12월 23일  09:34 include
drwxr-xr-x   2 root     bin          512 2008년  5월 21일 info
drwxr-xr-x   8 root     bin         3072 2008년  5월 21일 lib
drwxr-xr-x   4 root     bin          512 2008년  5월 21일 libexec
drwxr-xr-x   7 root     bin          512 12월 23일  09:34 man
drwxr-xr-x  12 mysql    other        512 2008년  5월 21일 mysql
drwxr-xr-x   3 root     other        512 2008년  5월 21일 php
drwxr-xr-x   2 root     bin          512 12월 23일  09:34 sbin
drwxr-xr-x  11 root     bin          512 2008년  5월 21일 share
drwxr-xr-x   9 root     bin          512 2008년  5월 21일 ssl
drwxr-xr-x   3 root     bin          512 12월 23일  10:11 var
-rw-r--r--   1 root     other       7342 12월 24일  13:43q

이 파일을 삭제 할려고 명령어를 해봤으나 파일, 디렉토리를 찾을 수 없다고 하면서 삭제 자체가 되지 않았습니다.

이때 inodefind 를 이용하여 삭제를 해보도록 하겠습니다.

# ls -lsia
총 58
     81762    2 drwxr-xr-x  20 root     other        512 12월 24일  13:43 .
         2    2 drwxr-xr-x  40 root     sys         1024 2008년  5월 21일 ..
    118423    2 drwxr-xr-x   7 root     bin          512 2008년  5월 21일 BerkeleyDB.4.2
    138503    2 drwxr-xr-x  13 root     other        512 2008년  5월 21일 apache
    137868    2 drwxr-xr-x  12 root     other        512 2008년  5월 21일 apache.org
     83214    4 drwxr-xr-x   2 root     bin         2048 12월 23일  09:34 bin
     96251    2 drwxr-xr-x  17 root     bin          512 12월 23일  09:34 doc
    150275    2 drwxr-xr-x   2 root     bin          512 12월 23일  09:34 etc
    150077    2 drwxr-xr-x   5 root     other        512 2008년  5월 21일 gd
     96280    2 drwxr-xr-x  10 root     bin         1024 12월 23일  09:34 include
    111766    2 drwxr-xr-x   2 root     bin          512 2008년  5월 21일 info
    111773    6 drwxr-xr-x   8 root     bin         3072 2008년  5월 21일 lib
    111882    2 drwxr-xr-x   4 root     bin          512 2008년  5월 21일 libexec
    111894    2 drwxr-xr-x   7 root     bin          512 12월 23일  09:34 man
    133553    2 drwxr-xr-x  12 mysql    other        512 2008년  5월 21일 mysql
    137869    2 drwxr-xr-x   3 root     other        512 2008년  5월 21일 php
    150337    2 drwxr-xr-x   2 root     bin          512 12월 23일  09:34 sbin
    111905    2 drwxr-xr-x  11 root     bin          512 2008년  5월 21일 share
    126905    2 drwxr-xr-x   9 root     bin          512 2008년  5월 21일 ssl
    155488    2 drwxr-xr-x   3 root     bin          512 12월 23일  10:11 var
     83314   16 -rw-r--r--   1 root     other       7342 12월 24일  13:43q

여기서 삭제할 파일의 inode 가 83314 인걸 알 수 있습니다.

이젠 find 명령어를 이용하여 삭제하겠습니다.

# find . -inum 83314 -exec rm {} \;   or     # find . -inum 83314 -exec rm -rf {} \;


밑의 명령어의 경우는 혹시 이런 파일들이 크래커의 해킹에 이용하는 파일이 될 가능성이 있기 때문에 일단 파일을 볼 수 있도록 정상파일로 수정하는 방법 입니다.

# find . -inum 83314 -exec mv {} filename \; 


이제 파일이 제대로 삭제 되었는지 확인을 하겠습니다.

# ls -al
총 42
drwxr-xr-x  20 root     other        512 12월 24일  14:30 .
drwxr-xr-x  40 root     sys         1024 2008년  5월 21일 ..
drwxr-xr-x   7 root     bin          512 2008년  5월 21일 BerkeleyDB.4.2
drwxr-xr-x  13 root     other        512 2008년  5월 21일 apache
drwxr-xr-x  12 root     other        512 2008년  5월 21일 apache.org
drwxr-xr-x   2 root     bin         2048 12월 23일  09:34 bin
drwxr-xr-x  17 root     bin          512 12월 23일  09:34 doc
drwxr-xr-x   2 root     bin          512 12월 23일  09:34 etc
drwxr-xr-x   5 root     other        512 2008년  5월 21일 gd
drwxr-xr-x  10 root     bin         1024 12월 23일  09:34 include
drwxr-xr-x   2 root     bin          512 2008년  5월 21일 info
drwxr-xr-x   8 root     bin         3072 2008년  5월 21일 lib
drwxr-xr-x   4 root     bin          512 2008년  5월 21일 libexec
drwxr-xr-x   7 root     bin          512 12월 23일  09:34 man
drwxr-xr-x  12 mysql    other        512 2008년  5월 21일 mysql
drwxr-xr-x   3 root     other        512 2008년  5월 21일 php
drwxr-xr-x   2 root     bin          512 12월 23일  09:34 sbin
drwxr-xr-x  11 root     bin          512 2008년  5월 21일 share
drwxr-xr-x   9 root     bin          512 2008년  5월 21일 ssl
drwxr-xr-x   3 root     bin          512 12월 23일  10:11 var

맨밑에 있는 q 파일이 삭제된것을 알 수 있습니다.

위에서 언급하였듯이 이런 파일이 약간의 부주의(vi 사용시 많이 생김)로 인해 생기지 않고 갑자기 생겼을 경우 크래커(해킹)에 의심을 해야 하니 조심 하시길 바랍니다.

Solaris9 Proftp 설치(패키지)

Posted 2008. 12. 23. 18:42


현재 제가 설치하는 것을 토대로 해서 적겠습니다. (2009.01.23)

환경 : Solaris9 SPARC


일단 http://sunfreeware.com 에 가셔서 Solaris9 SPARC  -> 밑의 파일들을 다운 받으세요~!

proftpd-1.3.1-sol9-sparc-local.gz
ncurses-5.6-sol9-sparc-local.gz

다운 받은 파일들을 Server로 옮기는건 각자 알아서.... ^^;

이제 설치를 하도록 하겠습니다.

일단 압축을 풀도록 하겠습니다.  해당 파일이 있는 디렉토리에 가셔서 밑의 명령어를 쓱쓱~

# gunzip -d  proftpd-1.3.1-sol9-sparc-local.gz
# gunzip -d  ncurses-5.6-sol9-sparc-local.gz


압축을 풀었으니 패키지 설치를..

# pkgadd -d ncurses-5.6-sol9-sparc-local

다음과 같은 패키지를 사용할 수 있습니다.
  1  SMCncurs     ncurses
                  (sparc) 5.6

처리할 패키지(들)를 선택하십시오.(또는 모든 패키지를
처리하려면'all'을 입력하십시오.) (default: all) [?,??,q]: all


# pkgadd -d proftpd-1.3.1-sol9-sparc-local

다음과 같은 패키지를 사용할 수 있습니다.
  1  SMCpftpd     proftpd
                  (sparc) 1.3.1

처리할 패키지(들)를 선택하십시오.(또는 모든 패키지를
처리하려면'all'을 입력하십시오.) (default: all) [?,??,q]: all


일단 설치 도중에 에러가 발생한다면 다른 필요한 라이브러리가 설치가 되지않아 생긴 문제이니 이건 어쩔수 없이 각자 알아서.. 설치를....

다 설치되었다는 가정하에

# vi /usr/local/etc/profptd.conf

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "ProFTPD Default Installation"
#ServerType                     inetd
ServerType                     standalone
DefaultServer                   on

# Port 21 is the standard FTP port.
Port                            21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances                    30

# Set the user and group under which the server will run.
User                            nobody
Group                          nobody

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

inetd로 등록을 할려고 하였으나  Error가 발생하여 다시 standalone으로 바꾸었습니다.
만약 상위 디렉토리로 이동이 되지 않도록 할려면 #DefaultrRoot ~ 가 주석처리 되어있는걸 해제해 주세요~!

이제 inetd.conf 파일에 등록을 할 차례입니다.
이 파일은 보안문제로 읽기 전용파일(444)로 되어있으니 실행 권한을 수정(755)하셔야 합니다.

# chmod 755 /etc/inet/inetd.conf

이렇게 한다음

# vi /etc/inet/inetd.conf

# FTPD - FTP server daemon
#ftp    stream  tcp6    nowait  root    /usr/sbin/in.ftpd       in.ftpd -a
ftp     stream  tcp6    nowait  root    /usr/local/sbin/in.proftpd      in.proftpd

전 FTP 부분을 찾아 원래 사용하던 ftp 를 주석처리하고 Proftpd 부분을 추가하여 사용하도록 하였습니다.

이제 inetd 를 재시작 하겠습니다.

#ps -ef | grep inetd

    root 14383     1  0 09:55:09 ?        0:00 /usr/sbin/inetd -s

꼭~ PID를 확인

#kill -HUP 14383

이제  /etc/inet/inetd.conf  파일 권한을 755 에서 원래대로인 444로 바꾸겠습니다.

# chmod 444 /etc/inet/inetd.conf

이제 ProFTP를 실행할 차례입니다.

# /usr/local/sbin/prftpd  or
# /usr/local/sbin/in.proftpd  를 실행하시고 테스트를 해보세요~!

처음 환영글이 ProFTP로 뜨게 되면 설치가 완료.


혹시 실행은 되는데 FTP 접속이 되지 않는다면 /etc/inet/inetd.conf 여기에 추가한

ftp     stream  tcp6    nowait  root    /usr/local/sbin/in.proftpd      in.proftpd
이 라인은 주석 처리하거나 삭제해 주세요.

그다음 아시죠? inet 재시작..

#ps -ef | grep inetd

    root 14383     1  0 09:55:09 ?        0:00 /usr/sbin/inetd -s

꼭~ PID를 확인

#kill -HUP 14383


그리고 직접 올릴수 있도록 파일을 만드는 작업을 해야합니다.

# vi /etc/init.d/proftpd

case "$1" in

'start')
     # Start the ProFTP daemon
     if [ -f /usr/local/sbin/proftpd ]; then
          echo "starting ProFTP daemon"
          /usr/local/sbin/proftpd &
     fi
     ;;

'stop')
     # Stop the ProFTP deamon
     PID=`/usr/bin/ps -e -u 0 | /usr/bin/fgrep proftpd | /usr/bin/awk '{print $1}'`
     if [ ! -z "$PID" ] ; then
          /usr/bin/kill ${PID} >/dev/null 2>&1
   echo "stoping ProFTP daemon"
     fi
     ;;

*)
     echo "usage: /etc/init.d/proftpd {start|stop}"
     ;;

esac
exit 0

이 내용이 적힌 파일을 첨부파일로 올리겠습니다.



# chown root:sys /etc/init.d/proftpd
profptd 파일의 소유자 및 그룹을  root:sys 로 변경

# chmod 755 /etc/init.d/proftpd
proftpd 파일의 권한을 755 (r-xr-xr-x)

# ln -s /etc/init.d/proftpd /etc/rc2.d/S99proftpd
/etc/init.d/proftpd 파일을 /etc/rc2.d/S99proftpd 파일을 만들면서 링크
그리고 /etc/rc2.d/S99proftpd 링크를 걸게 되면 Server Reboot 데몬이 자동 실행되어 가동이 됩니다.


아직 미숙한게 많아 아직도 테스트중입니다.  틀린점이 있더라도 너그럽게 용서를... ^^;

« PREV : 1 : 2 : 3 : 4 : 5 : NEXT »