service - 无法将瘦 Web 服务器作为服务运行 - 瘦 : unrecognized service

标签 service thin

我尝试根据 RVM and thin, root vs. local user 设置精简服务和 http://wiki.rubyonrails.org/deployment/nginx-thin?rev=1233246014

启动服务时,我得到了thin: unrecognized service。如何解决?

~ > sudo /usr/sbin/update-rc.d -f thin defaults 
update-rc.d: warning: thin stop runlevel arguments (0 1 6) do not match LSB Default-Stop values (S 0 1 6)
 Adding system startup for /etc/init.d/thin ...
   /etc/rc0.d/K20thin -> ../init.d/thin
   /etc/rc1.d/K20thin -> ../init.d/thin
   /etc/rc6.d/K20thin -> ../init.d/thin
   /etc/rc2.d/S20thin -> ../init.d/thin
   /etc/rc3.d/S20thin -> ../init.d/thin
   /etc/rc4.d/S20thin -> ../init.d/thin
   /etc/rc5.d/S20thin -> ../init.d/thin

我把daemon改成指向/usr/local/rvm/bin/bootup_thin

~ > sudo cat /etc/init.d/thin
#!/bin/sh
### BEGIN INIT INFO
# Provides:          thin
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      S 0 1 6
# Short-Description: thin initscript
# Description:       thin
### END INIT INFO

# Original author: Forrest Robertson

# Do NOT "set -e"

DAEMON=/usr/local/rvm/bin/bootup_thin
SCRIPT_NAME=/etc/init.d/thin
CONFIG_PATH=/etc/thin

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

case "$1" in
    start)
    $DAEMON start --all $CONFIG_PATH
    ;;
stop)
    $DAEMON stop --all $CONFIG_PATH
    ;;
restart)
    $DAEMON restart --all $CONFIG_PATH
    ;;
*)
   echo "Usage: $SCRIPT_NAME {start|stop|restart}" >&2
   exit 3
   ;;
esac

最佳答案

嗯,找到原因了。

首先我删除了/etc/init.d/thin,然后创建并忘记了 chmod +x 它。

所以在 chmod +x/etc/init.d/thin 之后就可以了。

关于service - 无法将瘦 Web 服务器作为服务运行 - 瘦 : unrecognized service,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11062533/

相关文章:

java - 如何阻止应用程序/服务被破坏?

java - Android - 创建一个每天运行一次的服务

ruby - "rvmsudo"的问题

ruby - Rails 开发服务器、PDFKit 和多线程

ruby-on-rails - 工头启动错误(server.rb :33,缺少参数...)

linux - 服务不会在 Linux Boot 上启动

service - 如何在批处理文件中使用 taskkill 终止名称中带有空格的 Windows 服务

linux - 如何在Linux中执行cron服务?

ruby-on-rails - Rails 3 编码::兼容性错误

ruby-on-rails - 如何使用 Xcode 4.5.1 在 OSX Lion 10.8.2 上编译 EventMachine gem