[master] f3bad4216 Unify -n argument documentation

Nils Goroll nils.goroll at uplex.de
Fri May 24 10:05:07 UTC 2024


commit f3bad421683148c45d820580ef78e47184867ebd
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Fri May 24 11:41:56 2024 +0200

    Unify -n argument documentation
    
    The host name default referenced by VUT_OPT_n is long gone since
    879c9b37ca108e365d4eb16ad391e28a8cfccd46
    
    Refer to varnishd(1) to avoid the documentation getting out of sync.
    
    Ref #4105

diff --git a/bin/varnishadm/varnishadm.c b/bin/varnishadm/varnishadm.c
index d08da8278..3f84afcc2 100644
--- a/bin/varnishadm/varnishadm.c
+++ b/bin/varnishadm/varnishadm.c
@@ -388,7 +388,7 @@ static void v_noreturn_
 usage(int status)
 {
 	fprintf(stderr,
-	    "Usage: varnishadm [-h] [-n ident] [-p] [-S secretfile] "
+	    "Usage: varnishadm [-h] [-n workdir] [-p] [-S secretfile] "
 	    "[-T [address]:port] [-t timeout] [command [...]]\n");
 	fprintf(stderr, "\t-n is mutually exclusive with -S and -T\n");
 	exit(status);
diff --git a/doc/sphinx/reference/varnishadm.rst b/doc/sphinx/reference/varnishadm.rst
index 8cfdc6983..9d4aee907 100644
--- a/doc/sphinx/reference/varnishadm.rst
+++ b/doc/sphinx/reference/varnishadm.rst
@@ -19,17 +19,17 @@ Control a running Varnish instance
 SYNOPSIS
 ========
 
-varnishadm [-h] [-n ident] [-p] [-S secretfile] [-T [address]:port] [-t timeout] [command [...]]
+varnishadm [-h] [-n workdir] [-p] [-S secretfile] [-T [address]:port] [-t timeout] [command [...]]
 
 
 DESCRIPTION
 ===========
 
 The `varnishadm` utility establishes a CLI connection to varnishd either
-using -n *name* or using the -T and -S arguments. If -n *name* is
-given the location of the secret file and the address:port is looked
-up in shared memory. If neither is given `varnishadm` will look for an
-instance without a given name.
+using -n *workdir* or using the -T and -S arguments. If -n *workdir* is
+given, the location of the secret file and the address:port are looked
+up in shared memory. If neither is given, `varnishadm` uses the -n
+defaults documented for :ref:`varnishd(1)`.
 
 If a command is given, the command and arguments are sent over the CLI
 connection and the result returned on stdout.
@@ -43,8 +43,11 @@ OPTIONS
 -h
     Print program usage and exit.
 
--n ident
-    Connect to the instance of `varnishd` with this name.
+-n workdir
+
+    Specify the varnish working directory of the instance to attach
+    to. See :ref:`varnishd(1)` ``-n`` option documentation for
+    additional information and defaults.
 
 -p
     Force `pass` mode and make the output follow the VCLI protocol.
diff --git a/doc/sphinx/reference/vsm.rst b/doc/sphinx/reference/vsm.rst
index 13671045e..ad2da1740 100644
--- a/doc/sphinx/reference/vsm.rst
+++ b/doc/sphinx/reference/vsm.rst
@@ -70,7 +70,7 @@ The Varnish way:
 
 When varnishd starts, it opens locked shared memory files, advising to
 use different -n arguments if an attempt is made to run multiple
-varnishd instances with the same name.
+varnishd instances on the same working directory.
 
 Child processes each use their own shared memory files, since a worker
 process restart marks a clean break in operation anyway.
diff --git a/doc/sphinx/users-guide/troubleshooting.rst b/doc/sphinx/users-guide/troubleshooting.rst
index 938cbf5c7..9ef176081 100644
--- a/doc/sphinx/users-guide/troubleshooting.rst
+++ b/doc/sphinx/users-guide/troubleshooting.rst
@@ -129,11 +129,9 @@ data.
    in the service's ``[Service]]`` section of the unit file.
 
 Once you have the core, ``cd`` into varnish's working directory (as
-given by the ``-n`` parameter, whose default is
-``$PREFIX/var/varnish/$HOSTNAME`` with ``$PREFIX`` being the
-installation prefix, usually ``/usr/local``, open the core with
-``gdb`` and issue the command ``bt`` to get a stack trace of the
-thread that caused the segfault.
+given by the ``-n`` parameter (see :ref:`varnishd(1)` for defaults),
+open the core with ``gdb`` and issue the command ``bt`` to get a stack
+trace of the thread that caused the segfault.
 
 A basic debug session for varnish installed under ``/usr/local`` could look
 like this::
diff --git a/include/vut_options.h b/include/vut_options.h
index 14eb0699e..534ff0cc1 100644
--- a/include/vut_options.h
+++ b/include/vut_options.h
@@ -69,10 +69,10 @@
 	)
 
 #define VUT_OPT_n							\
-	VOPT("n:", "[-n <dir>]", "varnishd working directory",		\
-	    "Specify the varnishd working directory (also known as"	\
-	    " instance name) to get logs from. If -n is not specified,"	\
-	    " the host name is used."					\
+	VOPT("n:", "[-n <workdir>]", "varnish working directory",	\
+	     "Specify the varnish working directory of the instance "	\
+	     "to attach to. See :ref:`varnishd(1)` ``-n`` option "	\
+	     "documentation for additional information and defaults."	\
 	)
 
 #define VUT_OPT_Q							\


More information about the varnish-commit mailing list