2011-06-09

CentOS: error while loading shared libraries: xxxxx.so: cannot restore segment prot after reloc: Permission denied

Linux 사용 중 아래와 같은 오류 발생시 해결 방법

오류메시지:
error while loading shared libraries: xxxxx.so: cannot restore segment prot after reloc: Permission denied


SELinux 보안 기능 때문에 발생하며, 해결하는 2가지 방법이 있다.

* 아래 명령은 CentOS (RHEL) 기준, OS 따라 명령 옵션이 조금씩 달라 질 수 있음



1) 해당 shared library 각각 마다 변경 (semanage, chcon)

# semanage fcontext -a -t textrel_shlib_t /xxx/xxx/xxx.so
$ chcon -f -t textrel_shlib_t /xxx/xxx/xxx.so

아래 명령으로 현재 설정된 내용을 확인 가능하다.
$ ls --lcontext 

시스템에서 관리하는 SELinux 정책 확인
# semanage fcontext -l


2) SELinux 보안 기능 끄기(또는 약화)

 /etc/selinux/config 파일 안의 내용 중

 SELINUX=enforcing    을 permissive(약화) 혹은 disabled (끄기)로 변경한다.
-
#SELINUX=enforcing
#SELINUX=permissive
SELINUX=disabled
-

재부팅 하지 않으려면
# cat /selinux/enforcing
1
# echo 0 > /selinux/enforcing

# cat /selinux/enforcing
0

댓글 없음:

댓글 쓰기