如何只为一个应用程序启动瘦身?

Mic*_*are 4 ruby ruby-on-rails thin

在/ etc/thin /我有几个yml文件.当我运行service thin stop -C /etc/thin/app.yml瘦身时停止所有应用程序,而不是仅我指定的应用程序.

如何瘦身才能停止/启动指定的应用程序?

更新:嗯,/etc/init.d/thin就是这样:$DAEMON restart --all $CONFIG_PATH.这解释了很多.有更聪明的init.d脚本吗?这是我的脚本:

https://gist.github.com/1003131

也可以看看:

使用瘦作为服务运行Rails应用程序

And*_*oni 5

你必须编辑/etc/init.d/thin添加新动作或修改"重启"动作.

如您所见,- all $ CONFIG_PATH将命令发送到所有精简实例.

将init脚本粘贴到某个地方,我们可以找到一个不错的解决方案;)

更新:

尝试添加以下行,下面这样:

restart)
  $DAEMON restart --all $CONFIG_PATH
  ;;
restart-single)
  $DAEMON restart -C $2
  ;;
stop-single)
  $DAEMON stop -C $2
  ;;
Run Code Online (Sandbox Code Playgroud)

我没试过,但它应该运作良好.这是一个非常简单的解决方案(没有错误检查),我们添加了两个必须被调用的新操作:

service thin restart-single /etc/thin/your_app.yml
or
service thin stop-single /etc/thin/your_app.yml
Run Code Online (Sandbox Code Playgroud)

让我知道它是否有效;)

欢呼声,A.