diff --git a/heartbeat/varnish b/heartbeat/varnish index 33f2783e9..fcd130db9 100755 --- a/heartbeat/varnish +++ b/heartbeat/varnish @@ -1,414 +1,414 @@ #!/bin/sh # # # Varnish # # Description: Manage varnish instances as a HA resource # # Author: Léon Keijser # # License: GNU General Public License (GPL) # # See usage() for more details # # OCF instance parameters: # OCF_RESKEY_pid # OCF_RESKEY_binary # OCF_RESKEY_client_binary # OCF_RESKEY_config # OCF_RESKEY_name # OCF_RESKEY_listen_address # OCF_RESKEY_mgmt_address # OCF_RESKEY_ttl # OCF_RESKEY_varnish_user # OCF_RESKEY_varnish_group # OCF_RESKEY_backend_type # OCF_RESKEY_backend_size # OCF_RESKEY_backend_file # OCF_RESKEY_worker_threads # ####################################################################### # Initialization: : ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/lib/heartbeat} . ${OCF_FUNCTIONS_DIR}/ocf-shellfuncs ####################################################################### # Set default paramenter values # Set these two first, as other defaults depend on it OCF_RESKEY_name_default=${OCF_RESOURCE_INSTANCE} : ${OCF_RESKEY_name=${OCF_RESKEY_name_default}} OCF_RESKEY_binary_default=varnishd OCF_RESKEY_client_binary_default=varnishadm OCF_RESKEY_pid_default=/var/run/varnishd_${OCF_RESKEY_name}.pid OCF_RESKEY_listen_address_default=0.0.0.0:80 OCF_RESKEY_ttl_default=600 OCF_RESKEY_varnish_user_default=varnish OCF_RESKEY_varnish_group_default=varnish OCF_RESKEY_backend_type_default=malloc OCF_RESKEY_backend_size_default=1G OCF_RESKEY_backend_file_default=/var/lib/varnish/${OCF_RESKEY_name}.bin OCF_RESKEY_worker_threads_default=100,3000,120 : ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}} : ${OCF_RESKEY_client_binary=${OCF_RESKEY_client_binary_default}} : ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}} : ${OCF_RESKEY_listen_address=${OCF_RESKEY_listen_address_default}} : ${OCF_RESKEY_ttl=${OCF_RESKEY_ttl_default}} : ${OCF_RESKEY_varnish_user=${OCF_RESKEY_varnish_user_default}} : ${OCF_RESKEY_varnish_group=${OCF_RESKEY_varnish_group_default}} : ${OCF_RESKEY_backend_type=${OCF_RESKEY_backend_type_default}} : ${OCF_RESKEY_backend_size=${OCF_RESKEY_backend_size_default}} : ${OCF_RESKEY_backend_file=${OCF_RESKEY_backend_file_default}} : ${OCF_RESKEY_worker_threads=${OCF_RESKEY_worker_threads_default}} meta_data() { cat < 1.0 The Varnish Resource Agent can manage several varnishd instances throughout the cluster. It does so by creating a unique PID file and requires a unique listen address and name for each instance. Manage a Varnish instance The VCL configuration file that varnish should manage, for example "/etc/varnish/default.vcl". VCL file - + Override the name of the instance that should be given to varnish (defaults to the resource identifier). Instance name - + Write the process's PID to the specified file. The default will include the specified name, ie.: "/var/run/varnish_production.pid". Unlike what this help message shows. It is most likely not necessary to change this parameter. Listen address - + Listen on this address:port, for example "192.168.1.1:80" Listen address Provide a management interface, for example "127.0.0.1:2222" Management interface - + - + Specifies a hard minimum time to live for cached documents. TTL - + Specifies the name of an unprivileged user to which the child process should switch before it starts accepting connections. Unprivileged user - + Specifies the name of an unprivileged group to which the child process should switch before it starts accepting connections. Unprivileged group - + Use the specified storage backend. Valid options are 'malloc' for memory and 'file' for a file backend. Backend type - + Specify the size of the backend. For example "1G". Backend size - + Specify the backend filename if you use backend_type file. For example /var/lib/varnish/mybackend.bin Backend file - + Start at least min but no more than max worker threads with the specified idle timeout. Syntax: min[,max[,timeout]] For example: 100,3000,120 Worker threads - + This is used to control varnish via a CLI. It's currently only used to check the status of the running child process. Varnish admin utility END } ####################################################################### varnish_usage() { cat <