Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
d0cd96d2
Unverified
Commit
d0cd96d2
authored
May 24, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate documentation of the varnishd -n option
with greetings from the rabbit-hole opened by #4105
parent
725c9d56
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
16 deletions
+38
-16
mgt_main.c
bin/varnishd/mgt/mgt_main.c
+16
-0
Makefile.am
doc/sphinx/Makefile.am
+5
-0
varnishd.rst
doc/sphinx/reference/varnishd.rst
+1
-13
vin.h
include/vin.h
+2
-1
vin.c
lib/libvarnish/vin.c
+12
-1
Makefile.am
man/Makefile.am
+2
-1
No files found.
bin/varnishd/mgt/mgt_main.c
View file @
d0cd96d2
...
...
@@ -79,6 +79,19 @@ static const char opt_spec[] = "?a:b:CdE:f:Fh:i:I:j:l:M:n:P:p:r:S:s:T:t:VW:x:";
/*--------------------------------------------------------------------*/
// Basic options documentation with compile time dependencies
static
void
mgt_DumpOptions
(
void
)
{
printf
(
".. _opt_n:
\n\n
"
);
printf
(
"-n workdir
\n\n
"
);
printf
(
" Runtime directory for the shared memory, "
"compiled VCLs etc.
\n\n
"
);
printf
(
" In performance critical applications, this directory "
"should be on a RAM backed filesystem.
\n\n
"
);
VIN_DumpDefaults
();
}
static
void
usage
(
void
)
{
...
...
@@ -121,6 +134,7 @@ usage(void)
printf
(
FMT
,
"-x cli"
,
"CLI command documentation"
);
printf
(
FMT
,
"-x builtin"
,
"Builtin VCL program"
);
printf
(
FMT
,
"-x optstring"
,
"List of getopt options"
);
printf
(
FMT
,
"-x options"
,
"Dynamic options documentation"
);
printf
(
"
\n
Operations options:
\n
"
);
...
...
@@ -359,6 +373,8 @@ mgt_x_arg(const char *x_arg)
mgt_DumpBuiltin
();
else
if
(
!
strcmp
(
x_arg
,
"optstring"
))
(
void
)
printf
(
"%s
\n
"
,
opt_spec
);
else
if
(
!
strcmp
(
x_arg
,
"options"
))
mgt_DumpOptions
();
else
ARGV_ERR
(
"Invalid -x argument
\n
"
);
}
...
...
doc/sphinx/Makefile.am
View file @
d0cd96d2
...
...
@@ -85,6 +85,11 @@ include/params.rst: $(top_builddir)/bin/varnishd/varnishd
mv
-f
${
@
}
_
${
@
}
BUILT_SOURCES
+=
include/params.rst
include/options.rst
:
$(top_builddir)/bin/varnishd/varnishd
$(top_builddir)
/bin/varnishd/varnishd
-x
options
>
${
@
}
_
mv
-f
${
@
}
_
${
@
}
BUILT_SOURCES
+=
include/options.rst
include/counters.rst
:
ln
-s
$(abs_top_builddir)
/lib/libvsc/counters.rst
$@
BUILT_SOURCES
+=
include/counters.rst
...
...
doc/sphinx/reference/varnishd.rst
View file @
d0cd96d2
...
...
@@ -142,19 +142,7 @@ Basic options
could later be accessed remotely, starting `varnishd` requires
local privileges.
.. _opt_n:
-n workdir
Runtime directory for the shared memory, compiled VCLs etc.
In performance critical applications, this directory should be
on a RAM backed filesystem.
Relative paths will be appended to `/var/run/` (NB: Binary packages
of Varnish may have adjusted this to the platform.)
The default value is `/var/run/varnishd` (NB: as above.)
.. include:: ../include/options.rst
Documentation options
---------------------
...
...
include/vin.h
View file @
d0cd96d2
...
...
@@ -33,6 +33,7 @@
#ifndef VIN_H_INCLUDED
#define VIN_H_INCLUDED
/* Th
is function lives
in both libvarnish and libvarnishapi */
/* Th
ese functions live
in both libvarnish and libvarnishapi */
char
*
VIN_n_Arg
(
const
char
*
n_arg
);
void
VIN_DumpDefaults
(
void
);
#endif
lib/libvarnish/vin.c
View file @
d0cd96d2
...
...
@@ -42,6 +42,7 @@
#include "vin.h"
#include "vsb.h"
#define VARNISH_DEFAULT_REL_NAME "varnishd"
char
*
VIN_n_Arg
(
const
char
*
n_arg
)
{
...
...
@@ -52,7 +53,7 @@ VIN_n_Arg(const char *n_arg)
AN
(
vsb
);
if
(
n_arg
==
NULL
||
n_arg
[
0
]
==
'\0'
)
{
VSB_cat
(
vsb
,
VARNISH_STATE_DIR
);
VSB_cat
(
vsb
,
"/
varnishd"
);
VSB_cat
(
vsb
,
"/
"
VARNISH_DEFAULT_REL_NAME
);
}
else
if
(
n_arg
[
0
]
==
'/'
)
{
VSB_cat
(
vsb
,
n_arg
);
}
else
{
...
...
@@ -66,3 +67,13 @@ VIN_n_Arg(const char *n_arg)
VSB_destroy
(
&
vsb
);
return
(
retval
);
}
void
VIN_DumpDefaults
(
void
)
{
printf
(
" Relative paths will be appended to ``%s``.
\n\n
"
,
VARNISH_STATE_DIR
);
printf
(
" The default value is ``%s``.
\n\n
"
,
VARNISH_STATE_DIR
"/"
VARNISH_DEFAULT_REL_NAME
);
printf
(
" Note: These defaults may be distribution specific.
\n\n
"
);
}
man/Makefile.am
View file @
d0cd96d2
...
...
@@ -78,7 +78,8 @@ varnishadm.1: $(top_builddir)/doc/sphinx/reference/varnishadm.rst
varnishd.1
:
\
$(top_builddir)/doc/sphinx/reference/varnishd.rst
\
$(top_builddir)/doc/sphinx/include/params.rst
$(top_builddir)/doc/sphinx/include/params.rst
\
$(top_builddir)/doc/sphinx/include/options.rst
$(BUILD_MAN)
$(top_builddir)
/doc/sphinx/reference/varnishd.rst
$@
varnishncsa.1
:
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment