Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm attempting to run Varnish, but it seems that a child process is dying on startup. Can anyone suggest the best way for me to go about debugging what's going wrong?

Background

I have a raspberry pi on which I'd installed Debian, which was running varnish fine. Recently, I decided to install Raspbian (An OS based on Debian, but optimised for the raspberry pi). To do this, I did a fresh install and used puppet to make sure that I had all the same settings as I did previously.

The only substantial difference between the two setups I can think of is that Raspbian uses a later version of Debian (Wheezy) than I had been using previously (Squeeze), so came with Varnish 3, rather than 2.

Debugging attempts so far:

I looked in /var/logs/syslog and found the following:

Sep 21 22:26:28 interceptor varnishd[15056]: Platform: Linux,3.1.9+,armv6l,-smalloc,-smalloc,-hcritbit
Sep 21 22:26:28 interceptor varnishd[15056]: child (15064) Started
Sep 21 22:26:28 interceptor varnishd[15056]: Pushing vcls failed:#012CLI communication error (hdr)
Sep 21 22:26:28 interceptor varnishd[15056]: Stopping Child
Sep 21 22:26:28 interceptor varnishd[15056]: Child (15064) died signal=11
Sep 21 22:26:28 interceptor varnishd[15056]: Child (-1) said Child starts
Sep 21 22:26:28 interceptor varnishd[15056]: Child cleanup complete
Sep 21 22:26:28 interceptor varnishd[15056]: Manager got SIGINT

I tried googling for the error, but couldn't find anything useful.

I also ran strace -f whilst restarting varnish, but obviously that returned a lot of output and I wasn't sure what to look for. I grepped for the pid of the child process (15064), but that didn't seem to match anything. The strace did contain lots of lines like

[pid 15114] close(131072)               = -1 EBADF (Bad file descriptor)                                                                                                                                  
[pid 15114] close(131071)               = -1 EBADF (Bad file descriptor)                                                                                                                          
[pid 15114] close(131070)               = -1 EBADF (Bad file descriptor)                                                                                                                                  
[pid 15114] close(131069)               = -1 EBADF (Bad file descriptor)                                                                                                                                  
[pid 15114] close(131068)               = -1 EBADF (Bad file descriptor)                                                                                                                                  
[pid 15114] close(131067)               = -1 EBADF (Bad file descriptor)                                                                                                                                  
[pid 15114] close(131066)               = -1 EBADF (Bad file descriptor)

but I'm not sure if this is normal or perhaps a result of my problem, rather that its cause.

Any advice on how I should proceed is much appreciated.

share|improve this question

closed as off topic by Michael Hampton, Scott Pack, Magellan, mdpc, Iain Oct 14 '12 at 12:18

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Your question is off topic for Serverfault because it doesn't appear to relate to servers/networking or desktop infrastructure in a professional environment. It may be on topic for raspberrypi but please search their site for similar questions that may already have the answer you're looking for. –  Iain Oct 14 '12 at 12:22
    
I've just searched that site for "varnish" - the only result was a reference to Polyurethane Varnish. Are you sure that's the best place to ask about debugging a segfault? –  lucas Oct 15 '12 at 0:33

2 Answers 2

The best output on failures during start is to stdout/stderr - but the default init scripts stop this output from being displayed.

Try running just varnishd -f /etc/varnish/default.vcl - this should show you any errors in loading your VCL.

share|improve this answer
    
The only output I get from that is WARNING: Taking over SHMFILE marked as owned by running process (pid=25946) If I run it a second time, I get no output at all, so I don't think it's a problem with the VCL file. –  lucas Sep 22 '12 at 17:53
    
@lucas Does the init script report a successful start when you use it to start/restart? –  Shane Madden Sep 22 '12 at 18:51
    
When I restart I get no errors, just ` Stopping HTTP accelerator: varnishd. Starting HTTP accelerator: varnishd. ` –  lucas Sep 23 '12 at 11:43

Try attaching running varnish with some very simple flags:

varnishd -l 8m -s file,/tmp,8m -b localhost:8080 -a 0.0.0.0:80 -w 2

and then attach the gdb debugger and see if you can find out why the child is segfaulting

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.