2013-10-30 128 views
0

HHVM在Docker中使用hhvm -m daemon运行时不会进入后台。该过程开始但不会将我返回到命令提示符。 ctl^c杀死这个过程。我的解决方法如下:如何在Docker中将HHVM作为守护进程运行?

  1. screen

任何想法,为什么安装screen

  • 运行exec >/dev/tty 2>/dev/tty </dev/tty
  • 运行screen
  • 运行HHVM

    谢谢。

  • 回答

    4

    你可能已经解决了这个问题,因为你问了这个问题(或者问题已经在hhvm的最新版本中被修复了),但是我还是会添加一些想法,因为我也是这么做的。

    守护模式(hhvm -m daemon

    似乎目前预期工作(Ubuntu的12.04):

    [email protected]:~# hhvm -m daemon 
    Log file not specified under daemon mode.\n\n 
    [email protected]:~# ps aux | grep hhvm 
    root  123 0.8 9.7 554212 36388 ?  Ss 21:33 0:00 hhvm -m daemon 
    

    独立服务器模式(hhvm -m server &

    [email protected]:~# hhvm -m server & 
    [1] 151 
    [email protected]:~# ps aux | grep hhvm 
    root  151 2.3 11.5 631128 43212 pts/0 Sl 21:36 0:00 hhvm -m server 
    

    服务器模式W/supervisord

    在你的supervisord配置中:

    [program:hhvm] 
    directory=/var/www 
    command=hhvm -m server 
    autostart=true 
    autorestart=true 
    redirect_stderr=true 
    

    假设你使用的主管,该选项可能是最痛苦的,除非你需要启动/停止特设HHVM instancess。另外,我敢肯定,你是知道的,但在supervisord过程中配置的directory选项可以通过HHVM CLI ARGS被复制,以及(所以它不是CWD为主),如:

    hhvm -m daemon -v Server.SourceRoot=/var/www 
    

    希望帮助。这么晚才回复很抱歉!

    相关问题