Mailing List Archive

varnish daemon as non root - vmods libraries directory
Hi,

Is there one way to configure varnish to read the vmods libraries in a
different directory?

I am asking this because of the permissions I have compiled and installed
the varnish in a different path using other user (non-root).

Everything works when I don't use any import in my VCL file.

but when I try to use for example "import std;", I receive an error
because the process is trying to read a system directory.


[docker@localhost varnish]$ /home/docker/varnish/sbin/varnishd -a :29800 -f
/home/docker/varnish/etc/default.vcl -T 127.0.0.1:6082 -p
thread_pool_min=50 -p thread_pool_max=1000 -S /home/docker/varnish/etc/secret
-s malloc,256M -n /home/docker/varnish/tmp -P /home/docker/varnish/run/
varnish.pid
Error:
Message from VCC-compiler:
Could not load VMOD std
* File name: libvmod_std.so*
* dlerror: /usr/local/lib/varnish/vmods/libvmod_std.so: cannot open
shared object file: No such file or directory*
('/home/docker/varnish/etc/default.vcl' Line 3 Pos 8)
import std;
-------###-

Running VCC-compiler failed, exited with 2
VCL compilation failed


I am not sure, but I believe that could be possible to configure other
folder because when the installation has finished, I saw that the libraries
is under a folder "lib"


[docker@localhost varnish]$ ls -ltr /home/docker/varnish
total 40
drwxrwxr-x 3 docker docker 4096 Jun 9 11:24 include
drwxrwxr-x 2 docker docker 4096 Jun 9 11:24 bin
drwxr-xr-x 3 docker docker 4096 Jun 9 11:24 var
drwxrwxr-x 6 docker docker 4096 Jun 9 11:24 share
drwxrwxr-x 4 docker docker 4096 Jun 9 11:24 lib
drwxrwxr-x 2 docker docker 4096 Jun 9 11:56 sysconfig
drwxrwxr-x 2 docker docker 4096 Jun 9 12:29 etc
drwxrwxr-x 2 docker docker 4096 Jun 9 12:29 run
drwxrwxr-x 2 docker docker 4096 Jun 9 12:33 sbin
drwxrwxr-x 4 docker docker 4096 Jun 9 12:37 tmp


[docker@localhost lib]$ find /home/docker/varnish/lib/
/home/docker/varnish/lib/
/home/docker/varnish/lib/pkgconfig
/home/docker/varnish/lib/pkgconfig/varnishapi.pc
/home/docker/varnish/lib/libvarnishapi.so
/home/docker/varnish/lib/libvarnishapi.la
/home/docker/varnish/lib/libvarnishapi.so.1.0.6
/home/docker/varnish/lib/varnish
/home/docker/varnish/lib/varnish/vmods
/home/docker/varnish/lib/varnish/vmods/libvmod_directors.so
*/home/docker/varnish/lib/varnish/vmods/libvmod_std.so*
/home/docker/varnish/lib/varnish/vmods/libvmod_directors.la
/home/docker/varnish/lib/varnish/vmods/libvmod_std.la
/home/docker/varnish/lib/libvarnishapi.so.1



I appreciate if someone could help me.


Thank you very much.

--
*Remo M. Furlanetto*
*E-mail:* *remofurlanetto@gmail.com <remofurlanetto@gmail.com>*
*Telefone:* (11) 99910-0565
Re: varnish daemon as non root - vmods libraries directory [ In reply to ]
On Fri, Jun 9, 2017 at 10:10 PM, Remo Furlanetto
<remofurlanetto@gmail.com> wrote:
> Hi,
>
> Is there one way to configure varnish to read the vmods libraries in a
> different directory?

You can use the `from` keyword:

import <name> from <path>;

There is also a vmod_dir or vmod_path parameter depending on your
version of Varnish, see man varnishd.

Dridi

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
Re: varnish daemon as non root - vmods libraries directory [ In reply to ]
Hi Dridi,

Thank you for your answer.

I have found a solution. I had to execute the script "configure" with
--exec-prefix
wget https://repo.varnish-cache.org/source/varnish-5.1.2.tar.gz
tar -xvzf varnish-5.1.2.tar.gz
cd varnish-5.1.2
./autogen.sh
./configure --prefix=/home/docker/varnish --exec-prefix=/home/docker/varnish
make
make install


Thank you

Remo.

On Fri, Jun 9, 2017 at 11:37 PM, Dridi Boukelmoune <dridi@varni.sh> wrote:

> On Fri, Jun 9, 2017 at 10:10 PM, Remo Furlanetto
> <remofurlanetto@gmail.com> wrote:
> > Hi,
> >
> > Is there one way to configure varnish to read the vmods libraries in a
> > different directory?
>
> You can use the `from` keyword:
>
> import <name> from <path>;
>
> There is also a vmod_dir or vmod_path parameter depending on your
> version of Varnish, see man varnishd.
>
> Dridi
>



--
*Remo M. Furlanetto*
*E-mail:* *remofurlanetto@gmail.com <remofurlanetto@gmail.com>*
*Telefone:* (11) 99910-0565
Re: varnish daemon as non root - vmods libraries directory [ In reply to ]
On Sat, Jun 10, 2017 at 12:16 AM, Remo Furlanetto
<remofurlanetto@gmail.com> wrote:
> Hi Dridi,
>
> Thank you for your answer.
>
> I have found a solution. I had to execute the script "configure" with
> --exec-prefix

Oh yes, that too. Since you mentioned installing to a different prefix
on purpose, I didnt think you needed help in this area. Whats weird is
that if you set --prefix but not --exec-prefix, the latter falls back
to the former.

Glad to see it worked out anyway.

Cheers

_______________________________________________
varnish-misc mailing list
varnish-misc@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc