<div dir="ltr">Varnish 5 was installed from .deb package (dpkg -i varnish_5.0.0-1_amd64.deb) and with<div><br><div>#service varnish start</div><div><br></div><div>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:</div></div><div><br></div><div>----------------------</div><div><div>root@2:~# service varnish status</div><div>● varnish.service - Varnish Cache, a high-performance HTTP accelerator</div><div>   Loaded: loaded (/lib/systemd/system/varnish.service; disabled; vendor preset:</div><div>  Drop-In: /etc/systemd/system/varnish.service.d</div><div>           └─override.conf</div><div>   Active: inactive (dead)</div><div><br></div><div>root@2:~# journalctl -xe|grep varnish</div><div><br></div><div>root@2:~# cat /etc/systemd/system/varnish.service.d/override.conf</div><div>[Service]</div><div>ExecStart=</div><div>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</div><div><br></div><div>root@2:~# cat /etc/default/varnish</div><div># Configuration file for Varnish Cache.</div><div>#</div><div># /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK</div><div># to be set from this shell script fragment.</div><div>#</div><div># Note: If systemd is installed, this file is obsolete and ignored.  You will</div><div># need to copy /lib/systemd/system/varnish.service to /etc/systemd/system/ and</div><div># edit that file.</div><div><br></div><div># Should we start varnishd at boot?  Set to "no" to disable.</div><div>START=yes</div><div><br></div><div># Maximum number of open files (for ulimit -n)</div><div>NFILES=131072</div><div><br></div><div># Maximum locked memory size (for ulimit -l)</div><div># Used for locking the shared memory log in memory.  If you increase log size,</div><div># you need to increase this number as well</div><div>MEMLOCK=82000</div><div><br></div><div>#DAEMON_OPTS="-a :80 \</div><div>DAEMON_OPTS="-a :80,:9443,:9444 \</div><div>             -T localhost:6082 \</div><div>             -f /etc/varnish/default.vcl \</div><div>             -S /etc/varnish/secret \</div><div>             -s malloc,256m"</div><div><br></div><div>root@2:/etc# locate S01varnish</div><div>/etc/rc2.d/S01varnish</div><div>/etc/rc3.d/S01varnish</div><div>/etc/rc4.d/S01varnish</div><div>/etc/rc5.d/S01varnish</div><div><br></div><div>root@2:/etc# ls -l rc2.d/S01varnish</div><div>lrwxrwxrwx 1 root root 17 Jan 27 14:39 rc2.d/S01varnish -> ../init.d/varnish</div><div><br></div><div>root@2:~# /etc/init.d/varnish start</div><div>[ ok ] Starting varnish (via systemctl): varnish.service.</div><div>root@2:~# <and all is well again></div><div><br></div><div>-----------------------------</div><div><br></div><div>Any input on this is highly appreciated.</div><div><br></div><div>Thank you.</div><div><br></div><div>-Asbjorn</div><div><br></div></div></div>