[master] 1941f86 Append a default system-wide location to vmod_path
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Mon Sep 12 12:59:12 CEST 2016
commit 1941f8638814e30d879af6eb2e9e129c503512f1
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date: Thu Aug 25 23:02:01 2016 +0200
Append a default system-wide location to vmod_path
By default: /usr/share/vcl
This directory becomes a drop-in, and standard location for library-like
VCL files. It streamlines third-party VCL packaging, offering a blessed
for installation, leaving the canonical /etc/varnish directory entirely
to the end-user.
While it is common to see VMOD packages in the wild, there are some VCL
libraries (sometimes backed by VMODs) that would benefit some form of
standardization. It then becomes possible to install packages, and use
relative includes that JustWork(tm). This is especially true for VCL
libraries that are split into several files, they can put themselves in
a subdirectory in /usr/share/vcl and use it as a namespace for includes
between files of the library:
# somewhere in my awesome "foo" library
include "foo/some_feature.vcl"
Choosing a default path of `/etc/varnish:/usr/share/vcl` prevents VCLs
dropped in the system from shadowing end-users VCLs but at the same
empowers said users to override a "standard" VCL in their `/etc` tree,
with no additional parameters fiddling.
diff --git a/bin/varnishd/Makefile.am b/bin/varnishd/Makefile.am
index 892b9c6..d629a4a 100644
--- a/bin/varnishd/Makefile.am
+++ b/bin/varnishd/Makefile.am
@@ -145,7 +145,7 @@ varnishd_CFLAGS = \
-DVARNISHD_IS_NOT_A_VMOD \
-DVARNISH_STATE_DIR='"${VARNISH_STATE_DIR}"' \
-DVARNISH_VMOD_DIR='"${pkglibdir}/vmods"' \
- -DVARNISH_VCL_DIR='"${varnishconfdir}"'
+ -DVARNISH_VCL_DIR='"${varnishconfdir}:${datarootdir}/varnish/vcl"'
varnishd_LDFLAGS = -export-dynamic
More information about the varnish-commit
mailing list