From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3ADA6158094 for ; Tue, 26 Jul 2022 08:28:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6FA3AE0F9A; Tue, 26 Jul 2022 08:28:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 47DDDE0F9A for ; Tue, 26 Jul 2022 08:28:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6F60D34109F for ; Tue, 26 Jul 2022 08:28:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B1731527 for ; Tue, 26 Jul 2022 08:28:31 +0000 (UTC) From: "Christian Ruppert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Christian Ruppert" Message-ID: <1658824108.3233b24b3e882edea9ad2752650baf1506b0ccc0.idl0r@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/haproxy/, net-proxy/haproxy/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-proxy/haproxy/files/haproxy.confd-r1 net-proxy/haproxy/files/haproxy.initd-r8 net-proxy/haproxy/haproxy-2.2.9999.ebuild net-proxy/haproxy/haproxy-2.4.9999.ebuild net-proxy/haproxy/haproxy-2.5.9999.ebuild net-proxy/haproxy/haproxy-2.6.2-r1.ebuild net-proxy/haproxy/haproxy-2.6.2.ebuild net-proxy/haproxy/haproxy-2.6.9999.ebuild net-proxy/haproxy/haproxy-9999.ebuild X-VCS-Directories: net-proxy/haproxy/files/ net-proxy/haproxy/ X-VCS-Committer: idl0r X-VCS-Committer-Name: Christian Ruppert X-VCS-Revision: 3233b24b3e882edea9ad2752650baf1506b0ccc0 X-VCS-Branch: master Date: Tue, 26 Jul 2022 08:28:31 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 82dd25a9-6d54-4224-a73c-ff59d36fad9f X-Archives-Hash: c943c37d5ecb32d1fd71b846ae4dcfdf commit: 3233b24b3e882edea9ad2752650baf1506b0ccc0 Author: Christian Ruppert gentoo org> AuthorDate: Tue Jul 26 08:13:20 2022 +0000 Commit: Christian Ruppert gentoo org> CommitDate: Tue Jul 26 08:28:28 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3233b24b net-proxy/haproxy: Fix reloading and use master-CLI Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Christian Ruppert gentoo.org> net-proxy/haproxy/files/haproxy.confd-r1 | 14 ++++ net-proxy/haproxy/files/haproxy.initd-r8 | 85 ++++++++++++++++++++++ net-proxy/haproxy/haproxy-2.2.9999.ebuild | 4 +- net-proxy/haproxy/haproxy-2.4.9999.ebuild | 4 +- net-proxy/haproxy/haproxy-2.5.9999.ebuild | 4 +- ...aproxy-2.6.2.ebuild => haproxy-2.6.2-r1.ebuild} | 4 +- net-proxy/haproxy/haproxy-2.6.9999.ebuild | 4 +- net-proxy/haproxy/haproxy-9999.ebuild | 4 +- 8 files changed, 111 insertions(+), 12 deletions(-) diff --git a/net-proxy/haproxy/files/haproxy.confd-r1 b/net-proxy/haproxy/files/haproxy.confd-r1 new file mode 100644 index 000000000000..b9bb84e3e833 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.confd-r1 @@ -0,0 +1,14 @@ +# HAProxy config file(s), space separated +#CONFIGS="/etc/haproxy/haproxy.cfg" + +# Additional HAProxy command line options +HAPROXY_OPTS="-S /run/haproxy-master.sock" + +# 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 "/run/haproxy/" +# socat /run/haproxy/socket - <<< "show servers state" > /run/haproxy/global.state +#} diff --git a/net-proxy/haproxy/files/haproxy.initd-r8 b/net-proxy/haproxy/files/haproxy.initd-r8 new file mode 100644 index 000000000000..4994c28b42d5 --- /dev/null +++ b/net-proxy/haproxy/files/haproxy.initd-r8 @@ -0,0 +1,85 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# 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 -W -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}" + start-stop-daemon --stop --pidfile="${_t}" + 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 $command_args -sf $(cat "${pidfile}") + eend $? +} diff --git a/net-proxy/haproxy/haproxy-2.2.9999.ebuild b/net-proxy/haproxy/haproxy-2.2.9999.ebuild index 4ec0188ead43..954368323612 100644 --- a/net-proxy/haproxy/haproxy-2.2.9999.ebuild +++ b/net-proxy/haproxy/haproxy-2.2.9999.ebuild @@ -124,8 +124,8 @@ src_install() { dosbin haproxy dosym ../sbin/haproxy /usr/bin/haproxy - newconfd "${FILESDIR}/${PN}.confd" ${PN} - newinitd "${FILESDIR}/${PN}.initd-r7" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} doman doc/haproxy.1 diff --git a/net-proxy/haproxy/haproxy-2.4.9999.ebuild b/net-proxy/haproxy/haproxy-2.4.9999.ebuild index a8f7f3e7ffd3..56ad7268073b 100644 --- a/net-proxy/haproxy/haproxy-2.4.9999.ebuild +++ b/net-proxy/haproxy/haproxy-2.4.9999.ebuild @@ -119,8 +119,8 @@ src_install() { dosbin haproxy dosym ../sbin/haproxy /usr/bin/haproxy - newconfd "${FILESDIR}/${PN}.confd" ${PN} - newinitd "${FILESDIR}/${PN}.initd-r7" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} doman doc/haproxy.1 diff --git a/net-proxy/haproxy/haproxy-2.5.9999.ebuild b/net-proxy/haproxy/haproxy-2.5.9999.ebuild index 2b772750ef60..853340e4fcb2 100644 --- a/net-proxy/haproxy/haproxy-2.5.9999.ebuild +++ b/net-proxy/haproxy/haproxy-2.5.9999.ebuild @@ -119,8 +119,8 @@ src_install() { dosbin haproxy dosym ../sbin/haproxy /usr/bin/haproxy - newconfd "${FILESDIR}/${PN}.confd" ${PN} - newinitd "${FILESDIR}/${PN}.initd-r7" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} doman doc/haproxy.1 diff --git a/net-proxy/haproxy/haproxy-2.6.2.ebuild b/net-proxy/haproxy/haproxy-2.6.2-r1.ebuild similarity index 98% rename from net-proxy/haproxy/haproxy-2.6.2.ebuild rename to net-proxy/haproxy/haproxy-2.6.2-r1.ebuild index 5fc0953b5485..6e17e38ddf96 100644 --- a/net-proxy/haproxy/haproxy-2.6.2.ebuild +++ b/net-proxy/haproxy/haproxy-2.6.2-r1.ebuild @@ -119,8 +119,8 @@ src_install() { dosbin haproxy dosym ../sbin/haproxy /usr/bin/haproxy - newconfd "${FILESDIR}/${PN}.confd" ${PN} - newinitd "${FILESDIR}/${PN}.initd-r7" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} doman doc/haproxy.1 diff --git a/net-proxy/haproxy/haproxy-2.6.9999.ebuild b/net-proxy/haproxy/haproxy-2.6.9999.ebuild index 5fc0953b5485..6e17e38ddf96 100644 --- a/net-proxy/haproxy/haproxy-2.6.9999.ebuild +++ b/net-proxy/haproxy/haproxy-2.6.9999.ebuild @@ -119,8 +119,8 @@ src_install() { dosbin haproxy dosym ../sbin/haproxy /usr/bin/haproxy - newconfd "${FILESDIR}/${PN}.confd" ${PN} - newinitd "${FILESDIR}/${PN}.initd-r7" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} doman doc/haproxy.1 diff --git a/net-proxy/haproxy/haproxy-9999.ebuild b/net-proxy/haproxy/haproxy-9999.ebuild index 5fc0953b5485..6e17e38ddf96 100644 --- a/net-proxy/haproxy/haproxy-9999.ebuild +++ b/net-proxy/haproxy/haproxy-9999.ebuild @@ -119,8 +119,8 @@ src_install() { dosbin haproxy dosym ../sbin/haproxy /usr/bin/haproxy - newconfd "${FILESDIR}/${PN}.confd" ${PN} - newinitd "${FILESDIR}/${PN}.initd-r7" ${PN} + newconfd "${FILESDIR}/${PN}.confd-r1" ${PN} + newinitd "${FILESDIR}/${PN}.initd-r8" ${PN} doman doc/haproxy.1