Varnish 5 wont start at boot on Ubuntu 16.04

Asbjorn Taugbol asbjornt at gmail.com
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
preset:
  Drop-In: /etc/systemd/system/varnish.service.d
           └─override.conf
   Active: inactive (dead)

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

root at 2:~# cat /etc/systemd/system/varnish.service.d/override.conf
[Service]
ExecStart=
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
$MEMLOCK
# to be set from this shell script fragment.
#
# Note: If systemd is installed, this file is obsolete and ignored.  You
will
# need to copy /lib/systemd/system/varnish.service to /etc/systemd/system/
and
# edit that file.

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

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

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

#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
/etc/rc2.d/S01varnish
/etc/rc3.d/S01varnish
/etc/rc4.d/S01varnish
/etc/rc5.d/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.

-Asbjorn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20170208/9c2ee186/attachment.html>


More information about the varnish-misc mailing list