2011-11-12 84 views
2

我正在使用Debian风格的linux系统。我正在使用瘦Web服务器在我的应用程序中获取呼叫的实时状态。当我使用/etc/init.d/thin start时,这个过程就开始了。我使用了update-rc.d -f thin默认设置,以便在系统引导时启动精简进程。在添加条目之后,我重新启动了系统,但精简进程没有启动。我检查了apache2,它在系统启动时正常启动。我在init.d中的瘦脚本如下,如何在系统启动时启动精简过程

DAEMON=/usr/local/lib/ruby/gems/1.9.1/bin/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/thin中的配置文件如下。

user_status.yml

--- 
chdir: /FMS/src/FMS-Frontend 
environment: production 
address: localhost    
port: 5000      
timeout: 30 
log: log/thin.log    
pid: tmp/pids/thin.pid   
max_conns: 1024 
max_persistent_conns: 512 
require: [] 

wait: 30       
servers: 1 
rackup: user_status.ru 
threaded: true     
daemonize: false 
+2

这不是http://askubuntu.com或http://unix.stackexchange.com的问题吗? – nathanvda

+0

您是否将脚本改为755? – valk

回答

0

您需要为 '薄' 的包装。 见https://rvm.io/integration/init-d。 包装程序路径需要在init.d脚本中替换DAEMON。 我一直忘记这一点,它花费了好几个小时! 现在我检查出来,以root身份进入这两个命令

rvm wrapper current bootup thin 
    which bootup_thin 

第一个创建了包装,第二给出了路径。 编辑在/etc/init.d/thin使用这条道路,并与

systemctl daemon-reload 
    service thin restart 

我假设一个多用户安装RVM的玩完DAEMON行,你也有

进入根
su - 

获得rvm环境的权利。

相关问题