0

I want to import std; and do some std.syslog. However, when I restart varnish, the VCC compiler fails:

$ sudo service varnish restart
 * Stopping HTTP accelerator varnishd                                [ OK ] 
 * Starting HTTP accelerator varnishd                                [fail] 
SMA.s0: max size 2048 MB.
Message from VCC-compiler:
Could not load module std
        /usr/lib/varnish/vmods/libvmod_std.so
        /usr/lib/varnish/vmods/libvmod_std.so: cannot open shared object file: No such file or directory
('input' Line 15 Pos 8)
import std;
-------###-

Running VCC-compiler failed, exit 1

VCL compilation failed

I'm running Ubuntu 11.10 and my varnish version:

$ varnishd -V
varnishd (varnish-3.0.0 revision cbf1284)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2011 Varnish Software AS

Isn't std a built-in VMOD? How can I solve this? Thanks.


UPDATE: I managed to upgrade Varnish to 3.0.3 by following the instructions on their official website. However, I still don't understand why std is not there in 3.0.0.

3 Answers 3

2

Download the latest source version 3.0.3 of Varnish and compile it. After installing, locate libvmod_std.so to confirm that this module is also installed. Then you can start the varnish to check it with your new vcl with import std;. For debugging you can add -d -d option in the varnish startup defaults in file /etc/default/varnish. Check man vmod_std for more detail on varnish standard module. It is working fine for me for this version.

Installation by default put the vcl file under /usr/local/etc/varnish and binaries under /usr/local/bin/varnish* and varnishd can be found in /usr/bin/. You need to change the following in the init.d startup file /etc/init.d/varnish because it is different from the installation by apt-get.

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/sbin/varnishd

Also change the vcl file path in the /etc/default/varnish like

-f /usr/local/etc/varnish/default.vcl

Now, you should be able to start and stop the newly compiled varnish like you used varnish installed via apt-get.

3
  • Will self-compiled version works seamlessly with Ubuntu? Since I have already installed Varnish through apt-get, I'm afraid something will be broken.
    – Xiao Jia
    Jan 2, 2013 at 6:02
  • Yes it will work seamlessly as I am using it too. Just remove the varnish with apt-get remove varnish before compiling it. Compilation is pretty standard. You just need to follow the step mentioned in the documentation. Jan 2, 2013 at 6:15
  • Thanks for your reply. Can I let the compiled varnish take over the apt-get one, so that my service will not be interrupt?
    – Xiao Jia
    Jan 2, 2013 at 7:05
0

Can you please upgrade your varnish on your machine with this command:

aptitude upgrade varnish

It should fix the problem. If not, please comment and will try to find some other fix.

1
  • Cannot upgrade it in this way. I'm running Ubuntu 11.10 so I suppose 3.0.0 is the latest version in the repository.
    – Xiao Jia
    Jan 2, 2013 at 9:27
0

I finally managed to upgrade Varnish to 3.0.3 by following the instructions on the official website: https://www.varnish-cache.org/installation/ubuntu

To use the varnish-cache.org repository, do the following

  1. curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add -
  2. echo "deb http://repo.varnish-cache.org/ubuntu/ lucid varnish-3.0" | sudo tee -a /etc/apt/sources.list
  3. sudo apt-get update
  4. sudo apt-get install varnish

They only provide packages for Ubuntu's LTS releases, not all the intermediate releases. So it says lucid but works fine with oneric (11.10).

After upgrading Varnish to 3.0.3, I can sudo service varnish reload and import std; works fine now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .