【问题标题】:Phusion-passenger crashPhusion-乘客碰撞
【发布时间】:2013-10-07 11:27:52
【问题描述】:

我正在使用带有 apache 的乘客来运行我的 ruby​​ 应用程序。我注意到乘客时不时会崩溃(apache 仍在工作),我需要手动重新启动 apache 以使其再次工作。

查看日志让我觉得它发生在 apache 更改日志文件时(存档当前文件并创建一个新文件)。这是 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 中的一个文件具有错误的权限,为什么它们是错误的?他们应该是什么?如何使它们正确?
  • 最后一条消息“恢复正常操作”似乎也是错误的,因为乘客已下线。它是一个错误吗?这是什么意思?
  • 我应该怎么做才能防止这种情况发生?

【问题讨论】:

  • 可能是一个错误,但需要更多调查。我在这里提出了问题:code.google.com/p/phusion-passenger/issues/detail?id=961
  • 不,抱歉,我无法重现该问题。能不能正常启动Apache,然后告诉我ls -l -d /tmp/passenger.*的输出是什么样子的?
  • 这里是:pastebin.com/0AXYJGMc
  • 嗯,看起来 /tmp 中的所有目录都打开了 setgid 标志。你能告诉我ls -l -d /tmp 的输出是什么样的吗?您系统上的/tmp 是一个单独的分区吗?如果是,它的挂载标志是什么?
  • tmp 不在单独的分区上。输出为drwxrwsrwt 11 root root 4,0K oct. 9 12:04 /tmp/

标签: apache passenger


【解决方案1】:

啊,我看到您使用的是 4.0.14 版本。请升级到最新版本,即 4.0.20。 4.0.17 之前的版本不能正确支持带有 setgid 标志的 /tmp 目录。

【讨论】:

  • 我更新了,等到今天早上发生的日志轮换,乘客还是一样坠毁。
  • 奇怪,我在 4.0.20 上使用 setgid /tmp 测试了您的设置,它对我有用。您可以尝试将PassengerTempDir 设置为不是/tmp 的地方吗?这将避免 /tmp 可能带来的任何剩余问题。
  • 好吧,看来这次可以了(我删除了setgid 标志)。谢谢。
  • @Hongli:我在Passenger 4.0.35 中遇到同样的“试图重用现有服务器”错误,这是回归吗?
  • 我不知道。您可以尝试将PassengerTempDir 设置到其他位置(不是/tmp 的位置)并检查是否有帮助?
【解决方案2】:

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

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

【讨论】:

  • 这对我有用。具体来说,stop 然后start 工作,而restart 失败。
猜你喜欢
  • 2011-12-09
  • 2012-04-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-07
相关资源
最近更新 更多