SELinux的许可被拒绝给Phusion Passenger用于redmine

时间:2013-10-16 10:25:52

标签: permissions centos passenger redmine selinux

我正在尝试在 CentOS 6.3 上安装 Redmine ,但我继续在日志文件中收到此错误

Passenger could not be initialized because of this error: Unable to start 
the Phusion Passenger watchdog (/usr/lib/ruby/gems/1.8/gems/passenger-4.0.20/buildout
 /agents/PassengerWatchdog): Permission denied (errno=13)

我一直在网上查找,无法在任何地方找到此错误或以任何方式解决此错误。我已尝试将文件夹的权限更改为777apache:apache但不起作用。

我用 redmine 工作的唯一解决方案是将 SELinux 设置为禁用或允许(我不想这样做)。

有没有其他方法可以解决此问题,使 SELinux 启用?

在/ var / log / messages

下找到SELinux日志文件

这是文件的结尾

    Oct 16 14:07:30 localhost pulseaudio[2329]: alsa-util.c: Disabling timer-based scheduling because running inside a VM.
    Oct 16 14:07:30 localhost rtkit-daemon[2183]: Sucessfully made thread 2331 of process 2329 (/usr/bin/pulseaudio) owned by '500' RT at priority 5.
    Oct 16 14:07:30 localhost pulseaudio[2329]: alsa-util.c: Disabling timer-based scheduling because running inside a VM.
    Oct 16 14:07:30 localhost rtkit-daemon[2183]: Sucessfully made thread 2332 of process 2329 (/usr/bin/pulseaudio) owned by '500' RT at priority 5.
    Oct 16 14:07:31 localhost rtkit-daemon[2183]: Sucessfully made thread 2427 of process 2427 (/usr/bin/pulseaudio) owned by '500' high priority at nice level -11.
    Oct 16 14:07:31 localhost pulseaudio[2427]: pid.c: Daemon already running.
    Oct 16 14:08:04 localhost kernel: type=1400 audit(1381957684.726:5): avc:  denied  { execute_no_trans } for  pid=2663 comm="httpd" path="/usr/lib/ruby/gems/1.8/gems/passenger-4.0.20/buildout/agents/PassengerWatchdog" dev=dm-0 ino=1048752 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:lib_t:s0 tclass=file
    Oct 16 14:08:04 localhost kernel: type=1400 audit(1381957684.760:6): avc:  denied  { execute_no_trans } for  pid=2668 comm="httpd" path="/usr/lib/ruby/gems/1.8/gems/passenger-4.0.20/buildout/agents/PassengerWatchdog" dev=dm-0 ino=1048752 scontext=unconfined_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:lib_t:s0 tclass=file
    Oct 16 14:09:11 localhost pulseaudio[2329]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write!
    Oct 16 14:09:11 localhost pulseaudio[2329]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_intel8x0'. Please report this issue to the ALSA developers.
    Oct 16 14:09:11 localhost pulseaudio[2329]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail.

有什么建议吗?

2 个答案:

答案 0 :(得分:5)

因此,您可以使用audit2allow(yum install audit-libs-python audit-libs)解决此问题。

SELinux登录到/var/log/audit/audit.log。如果您通过重新启动Web服务(服务httpd restart)来拖尾并捕获输出,则可以通过audit2allow运行新输出并在selinux下安装模块...

因此,假设您已将其捕获到名为“audit_tmp”的文件中:

cat audit_tmp | audit2allow -D -M passenger

这将创建一个名为passenger.pp的文件,您可以使用以下方法申请:

semodule -i passenger.pp

执行此操作将取消阻止乘客加载的第一件事 - 但请注意,可能会有更多内容,因此您需要再次重复此过程,直到它正常工作。我希望这是有道理的!

答案 1 :(得分:1)

看看/ var / log / syslog。该文件包含SELinux错误消息,告诉您如何解决任何权限问题。

相关问题