Varnish can't start occasionally

姚伟斌 nbubingo at gmail.com
Wed Apr 11 11:10:13 CEST 2012


I find the reason caused this problem. In our automatic start shell
script, There is such a line:
main >/dev/null 2>&1 <&- &

The shell script of "<&-" closes the STDIN. It seems the varnish CLI
interface need this. And The child process can't start at the
beginning.

You may reproduce this problem like this:
/path/to/varnish/init.d/varnish start <&-

This problem may be specific to our servers. It's not a bug. Hope this
can help someone else encounter the same problem.

2012/4/11 姚伟斌 <nbubingo at gmail.com>:
> Varnish can't start occasionally in our server. The /var/log/messages shows:
>
> Apr 10 07:07:31 detailbeta028054.cm4 /home/admin/varnish/cache[32416]:
> Manager got SIGINT
> Apr 10 07:07:32 detailbeta028054.cm4 /home/admin/varnish/cache[23091]:
> Platform: Linux,2.6.18-164.el5xen,x86_64,-sfile,-smalloc,-hcritbit
> Apr 10 07:07:32 detailbeta028054.cm4 varnishd[23092]: Not running as
> root, no priv-sep
> Apr 10 07:07:32 detailbeta028054.cm4 /home/admin/varnish/cache[23091]:
> child (23092) Started
> Apr 10 07:07:32 detailbeta028054.cm4 /home/admin/varnish/cache[23091]:
> Pushing vcls failed:
> Apr 10 15:07:32 detailbeta028054.cm4 CLI communication error (hdr)
> Apr 10 07:07:32 detailbeta028054.cm4 /home/admin/varnish/cache[23091]:
> Child (23092) died status=2
> Apr 10 07:07:32 detailbeta028054.cm4 /home/admin/varnish/cache[23091]:
> Child (-1) said Not running as root, no priv-sep
> Apr 10 07:07:32 detailbeta028054.cm4 /home/admin/varnish/cache[23091]:
> Child (-1) said Child starts
> Apr 10 07:07:32 detailbeta028054.cm4 /home/admin/varnish/cache[23091]:
> Child (-1) said SMF.s0 mmap'ed 0 bytes of 1073741824
>
> This problem occurs rarely.
>
> My varnishd start command is like this:
> /opt/taobao/install/varnish/sbin/varnishd -P
> /home/admin/varnish/pid/varnish.pid -a :8888 -f
> /home/admin/varnish/conf/varnish.vcl -n /home/admin/varnish/cache -T
> 0.0.0.0:2000 -t 120 -w 5,1000,120 -u admin -g admin -s
> file,/home/admin/varnish/cache/varnish_storage.bin,1G
>
> Is there anyone can give me some tips?
>
> Thanks.



More information about the varnish-misc mailing list