Varnish 5 wont start at boot on Ubuntu 16.04

Asbjorn Taugbol asbjornt at
Wed Feb 8 12:09:42 CET 2017

Varnish 5 was installed from .deb package (dpkg -i
varnish_5.0.0-1_amd64.deb) and with

#service varnish start

it starts and does its things very well. However, upon reboot it doesnt
start automatically. There may be some mixup between old /etc/init.d stuff
and newer systemd in debian/ubuntu. Here is some output for debugging this
after a reboot:

root at 2:~# service varnish status
● varnish.service - Varnish Cache, a high-performance HTTP accelerator
   Loaded: loaded (/lib/systemd/system/varnish.service; disabled; vendor
  Drop-In: /etc/systemd/system/varnish.service.d
   Active: inactive (dead)

root at 2:~# journalctl -xe|grep varnish

root at 2:~# cat /etc/systemd/system/varnish.service.d/override.conf
ExecStart=/usr/sbin/varnishd -a :80 -a :9443 -a :9444 -T localhost:6082 -f
/etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m

root at 2:~# cat /etc/default/varnish
# Configuration file for Varnish Cache.
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and
# to be set from this shell script fragment.
# Note: If systemd is installed, this file is obsolete and ignored.  You
# need to copy /lib/systemd/system/varnish.service to /etc/systemd/system/
# edit that file.

# Should we start varnishd at boot?  Set to "no" to disable.

# Maximum number of open files (for ulimit -n)

# Maximum locked memory size (for ulimit -l)
# Used for locking the shared memory log in memory.  If you increase log
# you need to increase this number as well

#DAEMON_OPTS="-a :80 \
DAEMON_OPTS="-a :80,:9443,:9444 \
             -T localhost:6082 \
             -f /etc/varnish/default.vcl \
             -S /etc/varnish/secret \
             -s malloc,256m"

root at 2:/etc# locate S01varnish

root at 2:/etc# ls -l rc2.d/S01varnish
lrwxrwxrwx 1 root root 17 Jan 27 14:39 rc2.d/S01varnish -> ../init.d/varnish

root at 2:~# /etc/init.d/varnish start
[ ok ] Starting varnish (via systemctl): varnish.service.
root at 2:~# <and all is well again>


Any input on this is highly appreciated.

Thank you.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list