3

我尝试根据RVM 和 Thin、root 与本地用户以及http://wiki.rubyonrails.org/deployment/nginx-thin?rev=1233246014设置瘦服务

而且我变瘦了:启动服务时无法识别服务。如何解决?

~ > 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

我将守护进程更改为指向 /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
4

1 回答 1

4

嗯,刚刚找到原因了。

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

所以在chmod +x /etc/init.d/thin它工作之后。

于 2012-06-16T10:48:26.437 回答