前提

Scientifc Linux 6.1 + nginx / yum 起動スクリプトを流用する » # watch -d tail /var/log/ngsw.log

検証

# nginx -V 2>&1 |grep --color '\-\-pid-path.*.pid'
  (snip)
  --pid-path=/var/run/nginx/nginx.pid
  (snip)

# ls /var/run/nginx/nginx.pid
  ls: cannot access /var/run/nginx/nginx.pid: そのようなファイルやディレクトリはありません

# nginx -t
  nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
  nginx: configuration file /etc/nginx/nginx.conf test is successful

# ls /var/run/nginx/nginx.pid
  /var/run/nginx/nginx.pid

# ?(´・ω・`)?

# /etc/init.d/nginx status
  nginx が停止していますが PID ファイルが残っています

# ?(´・ω・`)?

# /etc/init.d/nginx stop
  nginx を停止中: [失敗]

# ??(´・ω・`)??

# ls /var/run/nginx/nginx.pid
  ls: cannot access /var/run/nginx/nginx.pid: そのようなファイルやディレクトリはありません

# こういうものですか?
view raw nginx_t This Gist brought to you by GitHub.

ソースみてみなきゃな話だなー。

 

ようやくわかった

passenger_ruby /home/USER/.rbnev/versions/1.9.3-p0/bin/ruby;

passenger_ruby /home/USER/.rbnev/shims/ruby;
としていたため。とりあえずベタ書きで対応。

稼動しているサーバから持ってきた設定であったが、
おそらく以下のようなdot-file設定等々に影響してるのだろうな、と。
export PATH=”$HOME/.rbenv/bin:$PATH”
eval “$(rbenv init -)”
source ~/.rbenv/completions/rbenv.bash


今気がついて、まだ直せていない


/etc/init.d/nginx で起動すると
/home/USER/.rbenv/shims/ruby: line 4: exec: rbenv: not found
がnginxのerror_logに出続けるので修正する
例えば http://exmaple.com/ にアクセスするとして
Cannot spawn application ‘/path/to/rails_root’: Could not read from the spawn server: Connection reset by peer (104)
というエラーがでる
/usr/local/nginx/sbin/nginx も /etc/init.d.nginx start も
期待通りの挙動を示していないため、passengerとの連携に問題があると言えそう。
WEBRICK単独ではsinatraさんは期待通りに動いてくれている。

Continue reading »

© 2012 # watch -d tail /var/log/ngsw.log Suffusion theme by Sayontan Sinha