diff options
author | Christian Ruppert <idl0r@gentoo.org> | 2015-10-16 22:09:47 +0200 |
---|---|---|
committer | Christian Ruppert <idl0r@gentoo.org> | 2015-10-16 22:10:20 +0200 |
commit | baa4e242781638ae2d093ed51017b3b89a8c47e9 (patch) | |
tree | 556636af4d673954cdc5bf7c64d3d0969f31030b /net-proxy/haproxy/files | |
parent | net-proxy/haproxy: Remove old ebuilds (diff) | |
download | gentoo-baa4e242781638ae2d093ed51017b3b89a8c47e9.tar.gz gentoo-baa4e242781638ae2d093ed51017b3b89a8c47e9.tar.bz2 gentoo-baa4e242781638ae2d093ed51017b3b89a8c47e9.zip |
net-proxy/haproxy: Version bump to 1.6.0. Also fixes bug 555864
Package-Manager: portage-2.2.23
Diffstat (limited to 'net-proxy/haproxy/files')
-rw-r--r-- | net-proxy/haproxy/files/haproxy.confd | 14 | ||||
-rw-r--r-- | net-proxy/haproxy/files/haproxy.initd-r3 | 75 |
2 files changed, 89 insertions, 0 deletions
diff --git a/net-proxy/haproxy/files/haproxy.confd b/net-proxy/haproxy/files/haproxy.confd new file mode 100644 index 000000000000..5a989a776749 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.confd @@ -0,0 +1,14 @@ +# HAProxy config file(s), space separated +#CONFIGS="/etc/haproxy/haproxy.cfg" + +# Additional HAProxy command line options +HAPROXY_OPTS="" + +# If you want to make use ot the new seamless reload you can just write your own +# reload_seamless function here. It will be called by the init script. +# For more information on how to use that feature please have a look at the +# "seamless_reload.txt" documentation file (requires net-proxy/haproxy[examples]) +#reload_seamless() { +# checkpath -d -m 0700 haproxy:haproxy "/var/run/haproxy/" +# socat /var/run/haproxy/socket - <<< "show servers state" > /var/run/haproxy/global.state +#} diff --git a/net-proxy/haproxy/files/haproxy.initd-r3 b/net-proxy/haproxy/files/haproxy.initd-r3 new file mode 100644 index 000000000000..4b3a0e619b03 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd-r3 @@ -0,0 +1,75 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +extra_commands="checkconfig" +extra_started_commands="reload" + +command="/usr/bin/haproxy" + +pidfile="${HAPROXY_PIDFILE:-/var/run/${SVCNAME}.pid}" + +configs= + +if [ -z "${CONFIGS}" ]; then + if [ -f "/etc/haproxy/${SVCNAME}.cfg" ]; then + CONFIGS=/etc/haproxy/${SVCNAME}.cfg + elif [ -f "/etc/${SVCNAME}.cfg" ]; then + CONFIGS=/etc/${SVCNAME}.cfg # Deprecated + fi +fi + +for conf in $CONFIGS; do + configs="${configs} -f ${conf}" +done + +command_args="-D -p ${pidfile} ${configs} ${HAPROXY_OPTS}" + +depend() { + need net + use dns logger +} + +checkconfig() { + if [ -z "${CONFIGS}" ]; then + eerror "No config(s) has been specified" + return 1 + fi + + for conf in $CONFIGS; do + if [ ! -f "${conf}" ]; then + eerror "${conf} does not exist!" + return 1 + fi + done + + ebegin "Checking ${CONFIGS}" + $command -q -c $configs $HAPROXY_OPTS + eend $? +} + +start_pre() { + if [ "${RC_CMD}" != "restart" ]; then + checkconfig || return 1 + fi +} + +stop_pre() { + if [ "${RC_CMD}" = "restart" ]; then + checkconfig || return 1 + fi +} + +reload() { + checkconfig || { eerror "Reloading failed, please fix your config(s) first"; return 1; } + + if [ "$(command -v reload_seamless)" = "reload_seamless" ]; then + einfo "Calling user-defined reload_seamless()" + reload_seamless || { eerror "reload_seamless() failed!"; return 1; } + fi + + ebegin "Reloading ${SVCNAME}" + $command -D -p "${pidfile}" $configs $HAPROXY_OPTS -sf $(cat "${pidfile}") + eend $? +} |