在Procfile中打开localhost端口的多个进程

时间:2012-08-03 01:35:43

标签: process foreman

我正在尝试使用Foreman中的Procfile启动多个进程,在localhost上打开一个端口。这是我的Procfile

web: bundle exec puma
mongo: mongod
pubsub: bundle exec firehose server

现在,webpubsub分别打开了端口92927272。但是,当我运行foreman start时,Foreman启动第一个进程(web)并开始侦听端口9292,但不是7272。直到我使用Ctrl + C退出终端流程后,下一个流程(pubsub)才会启动。

这是我的终端输出。换行符是我点击Ctrl + C的地方。

tardis:clock[experimental]$ be foreman start
21:33:49 web.1    | started with pid 12870
21:33:49 mongo.1  | started with pid 12873
21:33:49 pubsub.1 | started with pid 12876
21:33:49 mongo.1  | /usr/lib/mongodb/mongod --help for help and startup options
21:33:49 mongo.1  | Thu Aug  2 21:33:49 Mongo DB : starting : pid = 12875 port = 27017 dbpath = /data/db/ master = 0 slave = 0  32-bit 
21:33:49 mongo.1  | ** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
21:33:49 mongo.1  | **       see http://blog.mongodb.org/post/137788967/32-bit-limitations for more
21:33:50 mongo.1  | Thu Aug  2 21:33:50 db version v1.4.4, pdfile version 4.5
21:33:50 mongo.1  | Thu Aug  2 21:33:50 git version: nogitversion
21:33:50 mongo.1  | Thu Aug  2 21:33:50 sys info: Linux roseapple 2.6.24-28-server #1 SMP Wed Aug 18 21:17:51 UTC 2010 i686 BOOST_LIB_VERSION=1_42
21:33:50 mongo.1  | Thu Aug  2 21:33:50 waiting for connections on port 27017
21:33:50 mongo.1  | Thu Aug  2 21:33:50 web admin interface listening on port 28017
21:33:57 web.1    | Sass is in the process of being separated from Haml,
21:33:57 web.1    | and will no longer be bundled at all in Haml 3.2.0.
21:33:57 web.1    | Please install the 'sass' gem if you want to use Sass.
21:33:58 web.1    |   DEBUG - MONGODB [DEBUG] Logging level is currently :debug which could negatively impact client-side performance. You should set your logging level no lower than :info in production.
21:33:58 mongo.1  | Thu Aug  2 21:33:58 connection accepted from 127.0.0.1:37172 #1
21:33:58 web.1    |   DEBUG - 
21:33:58 mongo.1  | Thu Aug  2 21:33:58 end connection 127.0.0.1:37172
21:34:01 web.1    | Puma 1.5.0 starting...
21:34:01 web.1    | * Min threads: 0, max threads: 16
21:34:01 web.1    | * Environment: development
21:34:01 web.1    | * Listening on tcp://0.0.0.0:9292
21:34:01 web.1    | Use Ctrl-C to stop

^C21:34:03 mongo.1  | Thu Aug  2 21:34:03 got kill or ctrl c signal 2 (Interrupt), will terminate after current cmd ends
21:34:03 mongo.1  | Thu Aug  2 21:34:03 now exiting
21:34:03 mongo.1  | Thu Aug  2 21:34:03  dbexit: 
21:34:03 mongo.1  | Thu Aug  2 21:34:03    shutdown: going to close listening sockets...
SIGINT received
21:34:03 system   | sending SIGTERM to all processes
21:34:03 mongo.1  | Thu Aug  2 21:34:03    going to close listening socket: 5
21:34:03 web.1    |  - Gracefully stopping, waiting for requests to finishSIGTERM received

21:34:03 mongo.1  | Thu Aug  2 21:34:03    going to close listening socket: 6
21:34:03 web.1    |  - Gracefully stopping, waiting for requests to finish
21:34:03 mongo.1  | Thu Aug  2 21:34:03    shutdown: going to flush oplog...
21:34:03 web.1    | /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/server.rb:639:in `close': closed stream (IOError)
21:34:03 mongo.1  | Thu Aug  2 21:34:03    shutdown: going to close sockets...
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/server.rb:639:in `stop'
21:34:03 mongo.1  | Thu Aug  2 21:34:03    shutdown: waiting for fs preallocator...
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/cli.rb:447:in `block in run'
21:34:03 mongo.1  | Thu Aug  2 21:34:03    shutdown: closing all files...
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/server.rb:642:in `call'
21:34:03 mongo.1  | Thu Aug  2 21:34:03      closeAllFiles() finished
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/server.rb:642:in `join'
21:34:03 mongo.1  | Thu Aug  2 21:34:03    shutdown: removing fs lock...
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/server.rb:642:in `stop'
21:34:03 mongo.1  | Thu Aug  2 21:34:03  dbexit: really exiting now
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/cli.rb:286:in `graceful_stop'
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/cli.rb:458:in `rescue in run'
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/lib/puma/cli.rb:455:in `run'
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/gems/puma-1.5.0/bin/puma:10:in `<top (required)>'
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/bin/puma:19:in `load'
21:34:03 web.1    |   from /home/ethan/.rvm/gems/ruby-1.9.3-p0/bin/puma:19:in `<main>'
21:34:03 pubsub.1 | >> Thin web server (v1.4.1 codename Chromeo)
21:34:03 pubsub.1 | >> Maximum connections set to 1024
21:34:03 pubsub.1 | >> Listening on 0.0.0.0:7474, CTRL+C to stop
21:34:03 pubsub.1 | >> Stopping ...
21:34:03 pubsub.1 | >> Stopping ...
21:34:03 web.1    | terminated by SIGTERM
21:34:03 mongo.1  | terminated by SIGTERM
21:34:03 pubsub.1 | terminated by SIGTERM

0 个答案:

没有答案