2015-02-04 18 views
0

SELinux와 관련된 것처럼 보이는 디렉토리 사용 권한을 변경하는 데 문제가 있습니다. 나는 SELinux를 비활성화하는 방법을 알아 내려고 노력하고있다. a) 나머지 요리사 - 클라이언트 세션과 b) 영구적으로.CentOS 5.10 상자에서 SELinux 세션을 비활성화하십시오.

리소스 :

# Change permissions for mounted repository 
directory "/home/analytics" do 
    owner "analytics" 
    mode "711" 
end 

오류 :

/sbin/restorecon set context /analytics/file failed:'Operation not supported' 

환경 :

SELinux가 작동을 망칠 것처럼 보입니다. 큰. SELinux를 비활성화하자!

주방장의 재고 구성이 허용으로 설정되어 있습니다.

[[email protected] selinux]# cat /etc/selinux/config 
# This file controls the state of SELinux on the system. 
# SELINUX= can take one of these three values: 
# enforcing - SELinux security policy is enforced. 
# permissive - SELinux prints warnings instead of enforcing. 
# disabled - SELinux is fully disabled. 
SELINUX=permissive 
# SELINUXTYPE= type of policy in use. Possible values are: 
# targeted - Only targeted network daemons are protected. 
# strict - Full SELinux protection. 
SELINUXTYPE=targeted 

구성을 템플릿으로 만들고 사용 안 함으로 설정할 수 있지만 다시 부팅 한 후에 만 ​​적용됩니다. 현재 세션에서 SELinux를 비활성화하는 것은 CLI (sestatus, setenforce 등)를 통해 수행됩니다. 우리의 요리 책 (및 the official one)은이 기능에 의존합니다. 하지만 여기에 깨진 것 같습니다 ...

[[email protected] selinux]# sestatus 
bash: sestatus: command not found 
[[email protected] selinux]# getstatus 
bash: getstatus: command not found 

[[email protected] selinux]# rpm -q policycoreutils 
policycoreutils-1.33.12-14.13.el5 

그래서 어떻게 상자를 재부팅하거나 요리사를 두 번 실행하지 않고 SELinux를 비활성화합니까?

+0

sestatus 및 getenforce는 '/ usr/sbin'디렉토리에 있으므로 절대 경로로 호출하십시오. 찾을 수 없으면 policycoreutils 패키지를 다시 설치하십시오. – dbndhjefj

+0

감사합니다. 나는/sbin에서 이것들을 찾고있었습니다. 내 실수. '[유랑 @ 분석-에 CentOS-510 sbin에] $ LS는/usr/sbin에/SE * 은/usr/sbin에/selinuxenabled 은/usr/sbin에/semodule 은/usr/sbin에/sestatus 은/usr/sbin에/semanage /usr/sbin/setenforce' –

답변

0

/etc/selinux/config의 설정을 DISABLED로 설정하여 새로운 .box를 작성하여 문제를 해결했습니다.

그러나 @szpal이 맞습니다. 빠른 테스트는 단순히 실행 자원의 전체 경로를 제공함으로써에서 세션에서 SELinux를 비활성화 할 수 표시

[[email protected] sbin]$ ls /usr/sbin/se* /usr/sbin/selinuxenabled /usr/sbin/semodule /usr/sbin/sestatus /usr/sbin/semanage /usr/sbin/setenforce 

: 바이너리은은/usr/sbin에 아래 (대신 내가 찾고 있었다/sbin 디렉토리,의) 있었다 :

execute "disable selinux - running" do 
     command "/usr/sbin/setenforce 0" 
end 
+0

참고로 SELinux를 비활성화하는 것이 아니라 허용 모드로 설정하는 것입니다. – dawud