varnishがSolarisで動作しない
先週えらい苦労してビルドしたSolaris10上でのvarnish。設定ファイルを作成して動かしてみたんですが、ちゃんと動作しません。フロントモードで動作させるとこんな。
# /usr/sbin/varnishd -F -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:9080 storage_malloc: max size 1024 MB. Message from C-compiler: /bin/sh: cc: 見つかりません。 Running C-compiler failed, exit 1 VCL compilation failed
# ln -s /usr/local/bin/gcc /usr/local/bin/cc # export PATH=$PATH:/usr/local/bin # /usr/sbin/varnishd -F -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:9080 storage_malloc: max size 1024 MB. Message from C-compiler: cc: unrecognized option '-Kpic' Using old SHMFILE child (10985) Started Pushing vcls failed: CLI communication error (hdr) Stopping Child Child (10985) died signal=6 Child (10985) Panic message: Assert error in wrk_herdtimer_thread(), cache_pool.c line 419: Condition(errno_is_multi_threaded != 0) not true. thread = (wrk_herdtimer) ident = -smalloc,-hcritbit,no_waiter Child (-1) said Child (-1) said Child starts Child cleanup complete
なにやらエラー。プロセスは動作していますが、TCP/9080でListenしてくれません。
configure.acを入れ替える
Google先生でエラーを検索したところ、まずこんな情報を発見。
configure.acのパッチをつくったよって書いてあります。
さっそく入れ替えてビルドしなおしたんですが、同じエラー。
ソースを変更する
次に見つけたのがこんな情報。
bin/varnishd/cache_acceptor.cの185行め。TCP_Assertを外しちまえというお話。
こうなっているのを
TCP_Assert(setsockopt(sp->fd, SOL_SOCKET, SO_LINGER, &linger, sizeof linger));
こうする。
setsockopt(sp->fd, SOL_SOCKET, SO_LINGER, &linger, sizeof linger);
本当かよ。これで再度makeしてみる。
動くかな。
# /usr/sbin/varnishd -F -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:9080 storage_malloc: max size 1024 MB. Message from C-compiler: cc: unrecognized option '-Kpic' Using old SHMFILE child (15080) Started Pushing vcls failed: CLI communication error (hdr) Stopping Child Child (15080) died signal=6 Child (15080) Panic message: Assert error in wrk_herdtimer_thread(), cache_pool.c line 419: Condition(errno_is_multi_threaded != 0) not true. thread = (wrk_herdtimer) ident = -smalloc,-hcritbit,no_waiter
残念。同じ結果でした。今日はここで挫折。