0

HHVM does not go into background when running it in Docker using hhvm -m daemon. The process starts but does not return me to command prompt. ctl^c kills the process. My workaround is as follows:

  1. Install screen
  2. Run exec >/dev/tty 2>/dev/tty </dev/tty
  3. Run screen
  4. Run HHVM from screen

Any idea why?

Thanks.

MarkL
  • 8,770
  • 7
  • 26
  • 27

1 Answers1

4

You've probably solved this since you asked the question (or the issue has since been fixed in recent versions of hhvm), but I'll add some thoughts as I was just doing this as well.

Daemon mode (hhvm -m daemon)

Seems to work as expected currently (Ubuntu 12.04):

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

Detached server mode (hhvm -m server &)

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

Server mode w/supervisord

In your supervisord config:

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

Assuming you use supervisor, that option is probably the most painless, unless you're needing to start/stop ad hoc hhvm instancess. Also, I'm sure you're aware, but the directory option in the supervisord process config can be replicated via hhvm CLI args as well (so it's not CWD-based), e.g.:

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

Hope that helps. Sorry for the late reply!

mway
  • 4,334
  • 3
  • 26
  • 37