[Unit] Description=Varnish a high-perfomance HTTP accelerator After=syslog.target network.target [Service] # # If you want to make changes to this file, please copy it to # /etc/systemd/system/varnish and make your changes there. # This will override the file kept at /lib/systemd/system/varnish # # # systemd specific configuration # # Maximum number of open files (for ulimit -n) LimitNOFILE=131072 # Locked shared memory (for ulimit -l) # Default log size is 82MB + header LimitMEMLOCK=82000 # Maximum size of the corefile. LimitCORE=infinity # # End of systemd specific configuration # # Varnish environment configuration description. This was derived from # the old style sysconfig/defaults settings # # DO NOT enter configuration within the comments here. Use the # Environment= section below. For better readability, the single line # Environment= is chopped with escaped newlines, that is single lines # ending with a '\'. The following environment variables may be used: # # Set this to 1 to make systemd reload try to switch vcl without restart. # RELOAD_VCL # # Main configuration file. You probably want to change it. # VARNISH_VCL_CONF # # Default address and port to bind to. Blank address means all IPv4 # and IPv6 interfaces, otherwise specify a host name, an IPv4 dotted # quad, or an IPv6 address in brackets. # VARNISH_LISTEN_ADDRESS # VARNISH_LISTEN_PORT # # Admin interface listen address and port # VARNISH_ADMIN_LISTEN_ADDRESS # VARNISH_ADMIN_LISTEN_PORT # # Shared secret file for admin interface # VARNISH_SECRET_FILE # # The minimum number of worker threads to start # VARNISH_MIN_THREADS # # The Maximum number of worker threads to start # VARNISH_MAX_THREADS # # Idle timeout for worker threads # VARNISH_THREAD_TIMEOUT # # Backend storage specification, see Storage Types in the varnishd(5) # man page for details. # VARNISH_STORAGE # # Default TTL used when the backend does not specify one # VARNISH_TTL # # End of varnish environment descriptiton # Environment= \ RELOAD_VCL=1 \ VARNISH_VCL_CONF=/etc/varnish/default.vcl \ VARNISH_PID_FILE=/var/run/varnish.pid \ VARNISH_USER=varnish \ VARNISH_GROUP=varnish \ VARNISH_LISTEN_PORT=6081 \ VARNISH_ADMIN_LISTEN_ADDRESS=127.0.0.1 \ VARNISH_ADMIN_LISTEN_PORT=6082 \ VARNISH_SECRET_FILE=/etc/varnish/secret \ VARNISH_MIN_THREADS=1 \ VARNISH_MAX_THREADS=1000 \ VARNISH_THREAD_TIMEOUT=120 \ VARNISH_TTL=120 \ VARNISH_STORAGE="file,/var/lib/varnish/varnish_storage.bin,1G" Type=forking PIDFile=/var/run/varnish.pid ExecStart=/usr/sbin/varnishd \ -P /var/run/varnish.pid \ -f $VARNISH_VCL_CONF \ -a ${VARNISH_LISTEN_ADDRESS}:${VARNISH_LISTEN_PORT} \ -T ${VARNISH_ADMIN_LISTEN_ADDRESS}:${VARNISH_ADMIN_LISTEN_PORT} \ -t $VARNISH_TTL \ -w ${VARNISH_MIN_THREADS},${VARNISH_MAX_THREADS},${VARNISH_THREAD_TIMEOUT} \ -u $VARNISH_USER \ -g $VARNISH_GROUP \ -S $VARNISH_SECRET_FILE \ -s $VARNISH_STORAGE \ $DAEMON_OPTS ExecReload=/usr/bin/varnish_reload_vcl [Install] WantedBy=multi-user.target