8

Running any of the commands varnishstat, varnishhist, varnishlog, varnishtop will give the error message as

Could not get hold of varnishd, is it running?

Below is some information for understanding.

sudo service varnish status

varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2017-11-15 15:28:04 UTC; 1h 16min ago
  Process: 10235 ExecStart=/usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=ex
 Main PID: 10251 (varnishd)
    Tasks: 217
   Memory: 106.2M
      CPU: 1.673s
   CGroup: /system.slice/varnish.service
           ├─10251 /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
           └─10271 /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m

Nov 15 15:28:03 varnish1 systemd[1]: Starting Varnish Cache, a high-performance HTTP accelerator...
Nov 15 15:28:04 varnish1 varnishd[10235]: Debug: Platform: Linux,4.11.0-1014-azure,x86_64,-junix,-smalloc,-smalloc,-hcritbit
Nov 15 15:28:04 varnish1 varnishd[10251]: Platform: Linux,4.11.0-1014-azure,x86_64,-junix,-smalloc,-smalloc,-hcritbit
Nov 15 15:28:04 varnish1 varnishd[10235]: Debug: Child (10271) Started
Nov 15 15:28:04 varnish1 varnishd[10251]: Child (10271) Started
Nov 15 15:28:04 varnish1 varnishd[10251]: Child (10271) said Child starts
Nov 15 15:28:04 varnish1 systemd[1]: Started Varnish Cache, a high-performance HTTP accelerator.

sudo service varnishd status

varnishd.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

sudo service varnishd start

Failed to start varnishd.service: Unit varnishd.service not found.

varnishd -V

varnishd (varnish-5.2.1 revision 67e562482)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2015 Varnish Software AS

Answer:

sudo varnishstat
sudo varnishhist
sudo varnishlog
sudo varnishtop
Sharath
  • 2,348
  • 8
  • 45
  • 81

4 Answers4

6

If you’re using Varnish utilities as unprivileged user, you’re probably missing privileges to execute some actions. For some distros, it’s enough to add yourself to Varnish’s group:

gpasswd -a my_user varnish

Then put the new group in use and at least varnishstat should work.

Smar
  • 8,109
  • 3
  • 36
  • 48
1

If sudo varnishstat doesn't help: check if varnish is started

sudo /etc/init.d/varnish start
numediaweb
  • 16,362
  • 12
  • 74
  • 110
0

Following worked fine for me:

sudo varnishadm

0

Found this thread, however the answers here did not help. As per: http://lists.varnish-cache.org/pipermail/varnish-misc/2020-July/026914.html when you have updated the serverhostname, you need a full server reboot.

Ramon Fincken
  • 253
  • 1
  • 5
  • 11