#!/bin/sh # # # Pound # # Description: Manage pound instances as a HA resource # # Author: Taro Matsuzawa # # License: GNU General Public License (GPL) # # See usage() for more details # # OCF instance parameters: # OCF_RESKEY_pid # OCF_RESKEY_binary # OCF_RESKEY_ctl_binary # OCF_RESKEY_socket_path # OCF_RESKEY_config # OCF_RESKEY_name # OCF_RESKEY_maxfiles # ####################################################################### # 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_config_default="" OCF_RESKEY_binary_default=pound OCF_RESKEY_ctl_binary_default=poundctl OCF_RESKEY_pid_default=/var/run/pound_${OCF_RESKEY_name}.pid OCF_RESKEY_socket_path_default=/var/lib/pound/pound.cfg OCF_RESKEY_maxfiles_default="" : ${OCF_RESKEY_config=${OCF_RESKEY_config_default}} : ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}} : ${OCF_RESKEY_ctl_binary=${OCF_RESKEY_ctl_binary_default}} : ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}} : ${OCF_RESKEY_socket_path=${OCF_RESKEY_socket_path_default}} : ${OCF_RESKEY_maxfiles=${OCF_RESKEY_maxfiles_default}} meta_data() { cat < 1.0 The Pound Resource Agent can manage Pound instances. Manage a Pound instance The Pound configuration file that Pound should manage, for example "/etc/pound.cfg". Pound configuration file Override the name of the instance that should be given to Pound (defaults to the resource identifier). Instance name Write the process's PID to the specified file. The default will include the specified name, i.e.: "/var/run/pound_production.pid". Unlike what this help message shows, it is most likely not necessary to change this parameter. Pidfile This is used to start Pound server. Normally use pound. This is used to watch Pound status via Unix socket. Normally use poundctl. Write the process's Unix socket. This parameter is same 'Control' parameter in configuration file, i.e.: Control "/var/lib/pound/pound.cfg". Determines how many files pound is allowed to open at a time. Helps to fix the 'Too many open files' error message. Allowed number of open files. END } ####################################################################### pound_usage() { cat <