失败:
# service auditd start Starting auditd: [Failed]
失败:
# /etc/init.d/auditd start Starting auditd: [Failed]
令人沮丧的是 – 工作:
# bash /etc/init.d/auditd start Starting auditd: [ OK ]
我在bash /etc/init.d/auditd中的各个地方添加了echo 1 echo 2之类的内容,因此请查看脚本采用的路径,但无济于事.
最终运行并失败的命令是
env -i PATH=/sbin:/usr/sbin:/bin:/usr/bin TERM=xterm /etc/init.d/auditd start
为什么添加bash使它工作?寻找故障排除的想法.
基于Michaels建议使用run_init,我可以从bash中获得一些有意义的调试:
#run_init bash -x /etc/init.d/auditd start [...] + /bin/bash -c 'ulimit -S -c 0 >/dev/null 2>&1 ; auditd ' + '[' 6 -eq 0 ']' + failure 'auditd startup'
在/ var / log / messages中我有
Dec 8 14:54:06 aws-sonar-01 kernel: type=1100 audit(1418050446.762:250): user pid=7196 uid=0 auid=500 ses=6 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:authentication acct="user" exe="/usr/sbin/run_init" hostname=? addr=? terminal=pts/0 res=success' Dec 8 14:54:06 aws-sonar-01 kernel: type=1101 audit(1418050446.777:251): user pid=7196 uid=0 auid=500 ses=6 subj=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 msg='op=PAM:accounting acct="user" exe="/usr/sbin/run_init" hostname=? addr=? terminal=pts/0 res=success' Dec 8 14:54:06 aws-sonar-01 kernel: type=1400 audit(1418050446.795:252): avc: denied { read } for pid=7200 comm="auditd" name="audit" dev=xvda1 ino=393285 scontext=system_u:system_r:auditd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=lnk_file Dec 8 14:54:06 aws-sonar-01 kernel: type=1300 audit(1418050446.795:252): arch=c000003e syscall=2 success=no exit=-13 a0=7fa0660a42a0 a1=90800 a2=4000 a3=19 items=0 ppid=7196 pid=7200 auid=500 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts0 ses=6 comm="auditd" exe="/sbin/auditd" subj=system_u:system_r:auditd_t:s0 key=(null) Dec 8 14:54:06 aws-sonar-01 auditd: Could not open dir /var/log/audit (Permission denied) Dec 8 14:54:06 aws-sonar-01 auditd: The audit daemon is exiting.
我尝试使用上面的输入生成策略
cat messages_above | grep awc | audit2allow -M audit semodule -i audit.pp
参与selinux政策制定 – 这是正确的吗?或遗漏任何东西?
semanage permissive -a auditd_t service auditd start tail -n 20 messages |grep auditd | audit2allow -M auditd semodule -i auditd.pp semanage permissive -d auditd_t
还是同样的问题