2011-11-12 83 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環境的權利。

相關問題