summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2017-07-04 15:20:55 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2017-07-04 15:22:25 -0700
commit6b2cb49fea06e38d1437e96f7d8a12e8fd6711e1 (patch)
treee86087410fc345bf6f1414e39aeef58a72fa0661 /net-proxy/haproxy/files
parentmedia-sound/xmms2: switch HOMEPAGE to https:// (diff)
downloadgentoo-6b2cb49fea06e38d1437e96f7d8a12e8fd6711e1.tar.gz
gentoo-6b2cb49fea06e38d1437e96f7d8a12e8fd6711e1.tar.bz2
gentoo-6b2cb49fea06e38d1437e96f7d8a12e8fd6711e1.zip
net-proxy/haproxy: bump & file moves.
- Add 1.7.7 release. - move haproxy & haproxy-systemd-wrapper binaries to sbin to match upstream & other distros, place symlinks in old location. Package-Manager: portage-2.3.6 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
Diffstat (limited to 'net-proxy/haproxy/files')
-rw-r--r--net-proxy/haproxy/files/haproxy.initd-r585
1 files changed, 85 insertions, 0 deletions
diff --git a/net-proxy/haproxy/files/haproxy.initd-r5 b/net-proxy/haproxy/files/haproxy.initd-r5
new file mode 100644
index 000000000000..0f2435f74339
--- /dev/null
+++ b/net-proxy/haproxy/files/haproxy.initd-r5
@@ -0,0 +1,85 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+extra_commands="checkconfig"
+extra_started_commands="reload"
+
+command="/usr/sbin/haproxy"
+
+pidfile="${HAPROXY_PIDFILE:-/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
+}
+
+stop() {
+ local _t _pid
+
+ _t="$(mktemp)"
+ for _pid in $(cat ${pidfile}) ; do
+ echo "${_pid}" > "${_t}"
+ pidfile="${_t}" default_stop
+ done
+ rm -f "${_t}"
+}
+
+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 $?
+}