Varnish as a daemon fails on CentOS 6

Mattias Geniar mattias at nucleus.be
Fri Nov 25 10:09:42 CET 2011


Hi,

I'm having a peculiar problem for which I don't see the solution
straight away, perhaps someone can point me in the right direction.

I'm trying to get Varnish 3.0.2 compiled from source to work on a CentOS
6 x64 running on an OpenVZ container (the openvz kernel could be messing
with me here).

If I manually start Varnish in the foreground, it works:
> # varnishd -F -f /usr/local/etc/varnish/default.vcl
> socket(): Address family not supported by protocol
> child (5214) Started
> Child (5214) said Child starts
> Child (5214) said SMF.s0 mmap'ed 104857600 bytes of 104857600
> ^CManager got SIGINT => CTRL+C killed
> Stopping Child

If I try via the service, it fails:
> # service varnish start
> Starting Varnish Cache:                                    [FAILED]

When I strace it, I don't see any immediate problem:
> # strace -e trace=file service varnish start
> execve("/sbin/service", ["service", "varnish", "start"], [/* 18 vars
*/]) = 0
> access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or
directory)
> open("/etc/ld.so.cache", O_RDONLY)      = 3
> open("/lib64/libtinfo.so.5", O_RDONLY)  = 3
> open("/lib64/libdl.so.2", O_RDONLY)     = 3
> open("/lib64/libc.so.6", O_RDONLY)      = 3
> open("/dev/tty", O_RDWR|O_NONBLOCK)     = 3
> open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
> open("/proc/meminfo", O_RDONLY)         = 3
> stat("/root", {st_mode=S_IFDIR|0550, st_size=4096, ...}) = 0
> stat(".", {st_mode=S_IFDIR|0550, st_size=4096, ...}) = 0
> open("/usr/lib64/gconv/gconv-modules.cache", O_RDONLY) = 3
> open("/sbin/service", O_RDONLY)         = 3
> open("/etc/init.d/functions", O_RDONLY) = 3
> --- SIGCHLD (Child exited) @ 0 (0) ---
> stat("/etc/sysconfig/i18n", {st_mode=S_IFREG|0644, st_size=47, ...}) =
0
> open("/dev/null", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
> open("/etc/profile.d/lang.sh", O_RDONLY) = 3
> stat("/root/.i18n", 0x7fffa8819680)     = -1 ENOENT (No such file or
directory)
> stat("/etc/sysconfig/init", {st_mode=S_IFREG|0644, st_size=1153, ...})
= 0
> open("/etc/sysconfig/init", O_RDONLY)   = 3
> open("/usr/share/locale/locale.alias", O_RDONLY) = 3
> open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/initscripts.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/share/locale/en_US.utf8/LC_MESSAGES/initscripts.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/share/locale/en_US/LC_MESSAGES/initscripts.mo", O_RDONLY) =
-1 ENOENT (No such file or directory)
> open("/usr/share/locale/en.UTF-8/LC_MESSAGES/initscripts.mo",
O_RDONLY) = -1 ENOENT (No such file or directory)
> open("/usr/share/locale/en.utf8/LC_MESSAGES/initscripts.mo", O_RDONLY)
= -1 ENOENT (No such file or directory)
> open("/usr/share/locale/en/LC_MESSAGES/initscripts.mo", O_RDONLY) = -1
ENOENT (No such file or directory)
> --- SIGCHLD (Child exited) @ 0 (0) ---
> --- SIGCHLD (Child exited) @ 0 (0) ---
> chdir("/")                              = 0
> stat("/etc/init.d/varnish", {st_mode=S_IFREG|0755, st_size=2851, ...})
= 0
> stat(".", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
> stat("/sbin/env", 0x7fffa881a600)       = -1 ENOENT (No such file or
directory)
> stat("/usr/sbin/env", 0x7fffa881a600)   = -1 ENOENT (No such file or
directory)
> stat("/bin/env", {st_mode=S_IFREG|0755, st_size=23832, ...}) = 0
> stat("/bin/env", {st_mode=S_IFREG|0755, st_size=23832, ...}) = 0
> access("/bin/env", X_OK)                = 0
> stat("/bin/env", {st_mode=S_IFREG|0755, st_size=23832, ...}) = 0
> access("/bin/env", R_OK)                = 0
> stat("/bin/env", {st_mode=S_IFREG|0755, st_size=23832, ...}) = 0
> stat("/bin/env", {st_mode=S_IFREG|0755, st_size=23832, ...}) = 0
> access("/bin/env", X_OK)                = 0
> stat("/bin/env", {st_mode=S_IFREG|0755, st_size=23832, ...}) = 0
> vaccess("/bin/env", R_OK)                = 0
> Starting Varnish Cache:                                    [FAILED]
> --- SIGCHLD (Child exited) @ 0 (0) ---

It fails right after the /bin/env call, which leads me to believe it is
probably environment-related, but I don't see any indication on where to
look.

The init.d script I used is in attachment, that one works fine on all
CentOS 5 x64 machines.

Regards,
Mattias
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: init_d_varnish.txt
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20111125/2bdc9c3f/attachment-0003.txt>


More information about the varnish-misc mailing list