自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

SELinux的故障排除技巧

運(yùn)維 系統(tǒng)運(yùn)維
本文是作者在Puppet部署報錯后,嘗試關(guān)閉了SELinux,之后就正常??墒窃跍y試環(huán)境中就沒這個問題。系統(tǒng)環(huán)境基本一致??纯催@個故障是如何排查出來的。

剛剛采用Puppet部署了dokuwiki,不過配置完成后報錯:

DokuWiki Setup Error
The datadir ('pages') at /pages is not found, isn't accessible or writable. You should check your config and permission settings. Or maybe you want to run the installer?

嘗試關(guān)閉了SELinux,之后就正常??墒窃跍y試環(huán)境中就沒這個問題。系統(tǒng)環(huán)境基本一致。

于是查看了下audit.log:

 tail -f /var/log/audit/audit.log | grep -i httpd

type=AVC msg=audit(1377479847.165:7269): avc:  denied  { search } for  pid=11160 comm="httpd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1377479847.165:7269): arch=40000003 syscall=33 success=no exit=-13 a0=1ebef68 a1=0 a2=1323e18 a3=f items=0 ppid=11149 pid=11160 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1122 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1377479847.166:7270): avc:  denied  { search } for  pid=11160 comm="httpd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1377479847.166:7270): arch=40000003 syscall=33 success=no exit=-13 a0=1ec5a58 a1=0 a2=1323e18 a3=f items=0 ppid=11149 pid=11160 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1122 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1377479847.166:7271): avc:  denied  { search } for  pid=11160 comm="httpd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1377479847.166:7271): arch=40000003 syscall=33 success=no exit=-13 a0=1eafc54 a1=0 a2=1323e18 a3=f items=0 ppid=11149 pid=11160 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1122 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1377479847.166:7272): avc:  denied  { search } for  pid=11160 comm="httpd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1377479847.166:7272): arch=40000003 syscall=33 success=no exit=-13 a0=1eafcb8 a1=0 a2=1323e18 a3=f items=0 ppid=11149 pid=11160 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1122 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1377479847.166:7273): avc:  denied  { search } for  pid=11160 comm="httpd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1377479847.166:7273): arch=40000003 syscall=33 success=no exit=-13 a0=1eb04e8 a1=0 a2=1323e18 a3=f items=0 ppid=11149 pid=11160 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1122 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)
type=AVC msg=audit(1377479847.166:7274): avc:  denied  { search } for  pid=11160 comm="httpd" name="/" dev=dm-2 ino=2 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=dir
type=SYSCALL msg=audit(1377479847.166:7274): arch=40000003 syscall=33 success=no exit=-13 a0=1eb0624 a1=0 a2=1323e18 a3=f items=0 ppid=11149 pid=11160 auid=0 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=1122 comm="httpd" exe="/usr/sbin/httpd" subj=unconfined_u:system_r:httpd_t:s0 key=(null)

HOHO,第一次處理SELinux的故障,看到其中的name、dev以及scontext和tcontext,于是在“/”下找找:

[root@localhost /]# ll -Z /
drwxr-xr-x. apache apache system_u:object_r:file_t:s0      wiki

后來發(fā)現(xiàn)是因為將wiki的目錄建在了“/”下面,并重新掛載了一個分區(qū),重新賦予權(quán)限就好了

[root@localhost /]# chcon -t httpd_t /wiki

對SELinux的了解還是太淺,呵呵。

責(zé)任編輯:黃丹 來源: 博客
相關(guān)推薦

2013-01-16 08:56:53

iOS故障排除指南

2023-07-26 15:46:52

Docker管理容器

2009-12-22 16:09:09

2013-05-06 16:36:55

SELinuxSELinux故障

2011-05-10 09:54:13

打印機(jī)故障排除

2011-05-06 15:22:19

打印機(jī)故障排除

2011-04-27 14:04:16

打印機(jī)故障

2023-08-31 16:43:46

軟件開發(fā)調(diào)試

2010-08-26 10:10:18

寬帶路由器

2011-02-21 15:48:19

2010-04-01 18:22:36

無線交換機(jī)故障

2021-01-25 09:05:21

Kubernetes命令運(yùn)維

2020-10-13 12:21:59

Kubernetes程序技巧

2011-08-10 14:03:53

2010-03-19 17:44:22

服務(wù)器RAIDRAID 5故障

2011-08-29 18:25:19

Ubuntu

2011-08-18 17:16:26

2020-03-04 14:50:38

Linux硬件故障

2009-01-13 09:31:00

雙絞線網(wǎng)絡(luò)故障

2010-08-02 17:45:05

NFS故障排除
點贊
收藏

51CTO技術(shù)棧公眾號