2013-10-07 75 views
1

我使用apache的乘客来运行我的红宝石应用程序。我注意到乘客不时崩溃(apache仍在工作),我需要手动重新启动apache以使其再次工作。Phusion-乘客崩溃

查看日志让我认为它发生在Apache更改日志文件时(归档当前并创建一个新日志)。这是临屋阿帕奇误差的tail -F日志文件看起来像:

tail: ‘/var/log/apache2/error.log’ has become inaccessible: No such file or directory           
tail: ‘/var/log/apache2/error.log’ has appeared; following end of new file              
[ 2013-10-06 05:05:27.2678 10498/7f3f0cf82740 agents/Watchdog/Main.cpp:459 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby1.9.1', 'default_user' => 'nobody', 'log_level' => '0', 'max_instances_per_app' => '0', 'max_pool_size' => '6', 'passenger_root' => '/var/lib/gems/1.9.1/gems/passenger-4.0.14', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_pid' => '18659', 'web_server_type' => 'apache', 'web_server_worker_gid' => '1000', 'web_server_worker_uid' => '1001' }                 
[Sun Oct 06 05:05:27 2013] [error] *** Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog because it encountered the following error during startup: Tried to reuse existing server instance directory /tmp/passenger.1.0.18659, but it has wrong permissions                    
[Sun Oct 06 05:05:27 2013] [notice] Apache/2.2.22 (Ubuntu) PHP/5.4.9-4ubuntu2.2 Phusion_Passenger/4.0.14 configured -- resuming normal operations 
  • 消息中提到的/tmp有错permissisons文件,他们为什么错了?他们应该是什么?如何让他们正确?
  • 最后一条消息“恢复正常操作”似乎是错误的,因为乘客下降。这是一个错误吗?这是什么意思?
  • 我应该怎么做才能防止这种情况发生?
+0

这可能是一个错误,但需要更多的调查。我在这里提出了问题:https://code.google.com/p/phusion-passenger/issues/detail?id=961 – Hongli

+0

不好意思,我不能重现这个问题。你能否正常启动Apache,然后告诉我ls -l -d/tmp/passenger。*'的输出是怎样的? – Hongli

+0

它是:http://pastebin.com/0AXYJGMc – gregseth

回答

2

啊,我看到你在4.0.14版本。请升级到最新版本,4.0.20。 4.0.17之前的版本没有正确支持带有setgid标志的/ tmp目录。

+0

我更新了,等到今天早上发生的日志轮转,乘客也一样坠毁。 – gregseth

+0

奇怪,我用setgid/tmp在4.0.20上测试了你的设置,它对我很有用。你可以尝试将PassengerTempDir设置为不是/ tmp的地方吗?这将避免/ tmp可能施加的任何剩余问题。 – Hongli

+0

好吧,看起来像这次工作(我删除了'setgid'标志)。谢谢。 – gregseth

1

在我的情况下,重启apache解决这个问题。

$ /etc/init.d/httpd stop 
$ /etc/init.d/httpd start 
+0

这对我来说是诀窍。具体来说,“停止”,然后“开始”工作,而“重新启动”失败。 –