VARNISHADM(1)

πŸ’– VARNISHADM(1) β€” the varnishadm page, but make it make sense πŸ’–

okay bestie, listen. this is the manual page for varnishadm, from the General Commands Manual, section 1. it's literally the lil remote control for a running Varnish instance. let's get into it πŸŽ€


✨ NAME ✨

varnishadm β€” control a running Varnish instance. that's it, that's the whole vibe. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

varnishadm [-h] [-n workdir] [-p] [-S secretfile] [-T [address]:port]
[-t timeout] [command [...]]

look at her. so structured. so iconic. πŸ‘‘


🌸 DESCRIPTION 🌸

so the varnishadm utility sets up a CLI connection to varnishd β€” and it does it one of two ways: either with -n workdir, or with the -T and -S arguments. pick your fighter. πŸ₯Š

if you pass -n workdir, then the location of the secret file and the address:port get looked up in shared memory. no cap, it just goes and finds them. πŸ”

if you give it neither of those, then varnishadm falls back on the -n defaults β€” the ones documented over in varnishd(1). so like, defaults are defaults, they're documented, go read them there. πŸ“–

if you hand it a command, that command plus its arguments get sent over the CLI connection, and the result comes back on stdout. simple as that. ✨

and if you give it no command argument at all? then varnishadm becomes your lil relay β€” it passes commands and replies back and forth between the CLI socket and stdin/stdout. it's giving customer service. it's giving middleman. 🫢


πŸ’… OPTIONS πŸ’…

  • -h β€” print the program usage and then exit. a lil help me out moment. πŸ™ˆ
  • -n workdir β€” specify the varnish working directory of the instance you wanna attach to. need more info? the varnishd(1) -n option documentation has the additional details and the defaults. go peek. πŸ‘€
  • -p β€” force pass mode, which makes the output follow the VCLI protocol. this disables command-history and command-completion, and it makes life way easier for programs that need to parse the response(s). it's giving machine-readable. πŸ€–
  • -S secretfile β€” specify the authentication secret file. heads up: this should be the same -S argument that was given to varnishd. and only processes that can actually read the contents of this file will be able to authenticate the CLI connection. so like, permissions matter, bestie. πŸ”
  • -T <address:port> β€” connect to the management interface at the specified address and port. πŸ“
  • -t timeout β€” don't wait any longer than this many seconds for an operation to finish. patience has a limit and it's this many seconds. ⏳

the syntax and operation of the actual CLI interface? that's all in the varnish-cli(7) manual page. the parameters? those live in the varnishd(1) manual page. different pages, different jobs. πŸ’–

oh and also β€” you can get a summary of commands by issuing the help command, and a summary of parameters by issuing the param.show command. built-in cheat sheets, we love to see it. 🌈


πŸŽ€ EXIT STATUS πŸŽ€

if a command is given, the exit status of the varnishadm utility is zero when the command succeeded, and non-zero otherwise. so like, 0 = slay, anything else = something went wrong. that's the whole rule. πŸ’€


πŸ”₯ EXAMPLES πŸ”₯

some ways you can use varnishadm:

varnishadm -T localhost:999 -S /var/db/secret vcl.use foo
echo vcl.use foo | varnishadm -T localhost:999 -S /var/db/secret
echo vcl.use foo | ssh vhost varnishadm -T localhost:999 -S /var/db/secret

three bangers. one of them even goes over ssh. versatility, periodt. πŸ‘‘


🌟 SEE ALSO 🌟


πŸ‘‘ AUTHORS πŸ‘‘

the varnishadm utility and this manual page were written by Cecilie Fritzvold. this man page has later been modified by Per Buer, Federico G. Schwindt and Lasse Karstensen. legends, all of them. 🫢


and that's the whole page, bestie!! this was VARNISHADM(1) from the General Commands Manual β€” go forth and control your Varnish instance responsibly. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from