2011-11-26 2 views
0

저는 데비안 6을 사용하는 새로운 Linode/Linux 사용자입니다. 부팅 할 때 유니콘 서버를 시작하려고하는데, 어떤 이유로 그것이 아닙니다. 오류 메시지를 추적 할 수 있습니다. Nginx는 정상적으로 시작하고 있으며 다중 사용자 RVM을 설치했습니다. 내 직감은 RVM과 관련이 있다는 것입니다. 이 /rails/todounicorn_init.sh 파일이며, 그것에 심볼릭 링크는 /etc/init.d/unicorn에있다 :Linode Deban Linux + Nginx + unicorn_rails

# unicorn_init.sh 
#!/bin/sh 

set -e 

TIMEOUT=${TIMEOUT-60} 
APP_ROOT=/rails/todo 
PID=$APP_ROOT/tmp/pids/unicorn.pid 
CMD="$APP_ROOT/bin/unicorn_rails -D -c $APP_ROOT/config/unicorn.rb -E production" 
GEM_HOME="/usr/local/rvm/gems/[email protected]" 
action="$1" 
set -u 

old_id="$PID.oldbin" 

cd $APP_ROOT || exit 1 
export GEM_HOME=$GEM_HOME 

sig() { 
    test -s "$PID" && kill -$1 `cat $PID` 
} 

oldsig() { 
    test -s $old_pid && kill -$1 `cat $old_pid` 
} 

case $action in 
    start) 
    sig 0 && echo >&2 "Already running" && exit 0 
    su -c "$CMD" - root 
    ;; 
    stop) 
    sig QUIT && exit 0 
    echo >&2 "Not running" 
    ;; 
    force-stop) 
    sig TERM && exit 0 
    echo >&2 "Not running" 
    ;; 
    restart|reload) 
    sig HUP && echo reloaded OK && exit 0 
    echo >&2 "Couldn't reload, starting '$CMD' instead" 
    su -c "$CMD" - root 
    ;; 
    upgrade) 
    if sig USR2 && sleep 2 && sig 0 && oldsig QUIT 
    then 
     n=$TIMEOUT 
     while test -s $old_pid && test $n -ge 0 
     do 
     printf '.' && sleep 1 && n=$(($n - 1)) 
     done 
     echo 

     if test $n -lt 0 && test -s $old_pid 
     then 
     echo >&2 "$old_pid still exists after $TIMEOUT seconds" 
     exit 1 
     fi 
     exit 0 
    fi 
    echo >&2 "Couldn't upgrade, starting '$CMD' instead" 
    su -c "$CMD" - root 
    ;; 
    reopen-logs) 
    sig USR1 
    ;; 
    *) 
    echo >&2 "Usage: $0 <start|stop|restart|upgrade|force-stop|reopen-logs>" 
    exit 1 
    ;; 
esac 

나는 많이 주시면 감사하겠습니다 내 설치 작업 - 어떤 조언을 얻기에 방법의 99 %입니다. 여기

$ update-rc.d unicorn defaults의 출력 :

update-rc.d: using dependency based boot sequencing 
insserv: warning: script 'unicorn' missing LSB tags and overrides 
insserv: There is a loop between service nginx and unicorn if stopped 
insserv: loop involving service unicorn at depth 2 
insserv: loop involving service nginx at depth 1 
insserv: Stopping unicorn depends on nginx and therefore on system facility `$all' which can not be true! 
insserv: exiting now without changing boot order! 
update-rc.d: error: insserv rejected the script header 

답변

2

update-rc.d: error: insserv rejected the script header

처럼 파일의 시작은 같습니다

# unicorn_init.sh 
#!/bin/sh 

오두막 라인 (#!/bin/sh)는의 첫 라인이어야한다 파일.

루프 탐지 메시지에 대해서는 언급 할 수 없습니다. 전에 본적이 없었습니다. /etc/init.d/nginx에서 unicorn에 대한 종속성을 표현하고 있다고 말할 수는 있지만, nginx에 대한 종속성을 나타내는 unicorn init에는 아무 것도 표시되지 않으므로 루프가 명확하지 않습니다.

insserv: warning: script 'unicorn' missing LSB tags and overrides

당신은 문제였다 누락 된 LSB 정보했다 당신의 init 스크립트 http://wiki.debian.org/LSBInitScripts

+0

에 LSB 정보를 추가해야합니다. 이 첫 번째 댓글은이 게시물에 대한 것입니다. – clem