Foreman产生的杀戮过程

Und*_*ion 9 ruby ruby-on-rails ruby-on-rails-3 foreman procfile

我有以下内容Procfile:

web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
redis: bundle exec redis-server /usr/local/etc/redis.conf
worker: bundle exec sidekiq
Run Code Online (Sandbox Code Playgroud)

跑步$ foreman start启动Unicorn,Redis和Sidekiq,但我应该如何再次阻止他们?

杀死福尔曼让所有三个人都离开了.我可以看到这个使用ps:

$ ps aux | grep redis | grep -v grep
    me           61560   0.0  0.0  2506784   1740 s000  S+    9:36am   0:01.28 redis-server /usr/local/etc/redis.conf
$ ps aux | grep sidekiq  | grep -v grep
    me           61561   0.0  1.0  2683796 173284 s000  S+    9:36am   0:14.18 sidekiq 2.17.0 pathways [0 of 25 busy]
$ ps aux | grep unicorn | grep -v grep
    me           61616   0.0  0.2  2615284  28312 s000  S+    9:37am   0:00.06 unicorn worker[2] -p 5000 -c ./config/unicorn.rb
    me           61615   0.0  0.2  2615284  27920 s000  S+    9:37am   0:00.06 unicorn worker[1] -p 5000 -c ./config/unicorn.rb
    me           61614   0.0  0.2  2615284  27772 s000  S+    9:37am   0:00.06 unicorn worker[0] -p 5000 -c ./config/unicorn.rb
    me           61559   0.0  1.0  2615284 160988 s000  S+    9:36am   0:09.87 unicorn master -p 5000 -c ./config/unicorn.rb
Run Code Online (Sandbox Code Playgroud)

所以显然我可以手动完成kill每个进程,但是如何一次性杀死所有进程呢?Foreman似乎不支持这一点.

Und*_*ion 8

用一个班轮来杀死他们:

$ kill $(ps aux | grep -E 'redis|sidekiq|unicorn' | grep -v grep | awk '{print $2}')
Run Code Online (Sandbox Code Playgroud)