From 39e927e92336692dd58298e1a6d585181a2ccee9 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 15 Jul 2019 13:11:36 -0700 Subject: app-admin/consul: increase max open files See: https://learn.hashicorp.com/consul/datacenter-deploy/deployment-guide#configure-systemd Package-Manager: Portage-2.3.69, Repoman-2.3.16 Copyright: Sony Interactive Entertainment Inc. Signed-off-by: Zac Medico --- app-admin/consul/consul-1.5.1-r1.ebuild | 69 +++++++++++++++++++++++++++++++++ app-admin/consul/consul-1.5.1.ebuild | 69 --------------------------------- app-admin/consul/files/consul.initd | 1 + app-admin/consul/files/consul.service | 5 ++- 4 files changed, 74 insertions(+), 70 deletions(-) create mode 100644 app-admin/consul/consul-1.5.1-r1.ebuild delete mode 100644 app-admin/consul/consul-1.5.1.ebuild (limited to 'app-admin') diff --git a/app-admin/consul/consul-1.5.1-r1.ebuild b/app-admin/consul/consul-1.5.1-r1.ebuild new file mode 100644 index 000000000000..23474dcfc441 --- /dev/null +++ b/app-admin/consul/consul-1.5.1-r1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit golang-vcs-snapshot systemd user +GIT_COMMIT="40cec98" +KEYWORDS="~amd64" +EGO_PN="github.com/hashicorp/consul" +DESCRIPTION="A tool for service discovery, monitoring and configuration" +HOMEPAGE="https://www.consul.io" +SRC_URI="https://github.com/hashicorp/consul/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +SLOT="0" +LICENSE="MPL-2.0" +IUSE="" + +RESTRICT="test" + +DEPEND="dev-go/gox + >=dev-lang/go-1.11:= + >=dev-go/go-tools-0_pre20160121" +RDEPEND="" + +pkg_setup() { + enewgroup consul + enewuser consul -1 -1 /var/lib/${PN} consul +} + +src_prepare() { + default + + sed -e 's:go get -u -v $(GOTOOLS)::' \ + -e 's:vendorfmt dev-build:dev-build:' \ + -i "src/${EGO_PN}/GNUmakefile" || die +} + +src_compile() { + # The dev target sets causes build.sh to set appropriate XC_OS + # and XC_ARCH, and skips generation of an unused zip file, + # avoiding a dependency on app-arch/zip. + GOPATH="${S}" \ + GOBIN="${S}/bin" \ + GIT_DESCRIBE="v${PV}" \ + GIT_DIRTY="" \ + GIT_COMMIT="${GIT_COMMIT}" \ + emake -C "src/${EGO_PN}" dev-build +} + +src_install() { + local x + + dobin bin/consul + + keepdir /etc/consul.d + insinto /etc/consul.d + doins "${FILESDIR}/"*.json.example + + for x in /var/{lib,log}/${PN}; do + keepdir "${x}" + fowners consul:consul "${x}" + done + + newinitd "${FILESDIR}/consul.initd" "${PN}" + newconfd "${FILESDIR}/consul.confd" "${PN}" + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotated" "${PN}" + systemd_dounit "${FILESDIR}/consul.service" +} diff --git a/app-admin/consul/consul-1.5.1.ebuild b/app-admin/consul/consul-1.5.1.ebuild deleted file mode 100644 index 23474dcfc441..000000000000 --- a/app-admin/consul/consul-1.5.1.ebuild +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 1999-2019 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit golang-vcs-snapshot systemd user -GIT_COMMIT="40cec98" -KEYWORDS="~amd64" -EGO_PN="github.com/hashicorp/consul" -DESCRIPTION="A tool for service discovery, monitoring and configuration" -HOMEPAGE="https://www.consul.io" -SRC_URI="https://github.com/hashicorp/consul/archive/v${PV}.tar.gz -> ${P}.tar.gz" - -SLOT="0" -LICENSE="MPL-2.0" -IUSE="" - -RESTRICT="test" - -DEPEND="dev-go/gox - >=dev-lang/go-1.11:= - >=dev-go/go-tools-0_pre20160121" -RDEPEND="" - -pkg_setup() { - enewgroup consul - enewuser consul -1 -1 /var/lib/${PN} consul -} - -src_prepare() { - default - - sed -e 's:go get -u -v $(GOTOOLS)::' \ - -e 's:vendorfmt dev-build:dev-build:' \ - -i "src/${EGO_PN}/GNUmakefile" || die -} - -src_compile() { - # The dev target sets causes build.sh to set appropriate XC_OS - # and XC_ARCH, and skips generation of an unused zip file, - # avoiding a dependency on app-arch/zip. - GOPATH="${S}" \ - GOBIN="${S}/bin" \ - GIT_DESCRIBE="v${PV}" \ - GIT_DIRTY="" \ - GIT_COMMIT="${GIT_COMMIT}" \ - emake -C "src/${EGO_PN}" dev-build -} - -src_install() { - local x - - dobin bin/consul - - keepdir /etc/consul.d - insinto /etc/consul.d - doins "${FILESDIR}/"*.json.example - - for x in /var/{lib,log}/${PN}; do - keepdir "${x}" - fowners consul:consul "${x}" - done - - newinitd "${FILESDIR}/consul.initd" "${PN}" - newconfd "${FILESDIR}/consul.confd" "${PN}" - insinto /etc/logrotate.d - newins "${FILESDIR}/${PN}.logrotated" "${PN}" - systemd_dounit "${FILESDIR}/consul.service" -} diff --git a/app-admin/consul/files/consul.initd b/app-admin/consul/files/consul.initd index 6d04eb564306..00a65695fa2b 100644 --- a/app-admin/consul/files/consul.initd +++ b/app-admin/consul/files/consul.initd @@ -7,6 +7,7 @@ extra_started_commands="reload" group=${group:-${RC_SVCNAME}} user=${user:-${RC_SVCNAME}} pidfile=${pidfile:-"/run/${RC_SVCNAME}.pid"} +rc_ulimit=${rc_ulimit-"-n 65536"} command="/usr/bin/${RC_SVCNAME}" command_args="agent ${command_args:-config-dir=/etc/consul.d}" command_background="true" diff --git a/app-admin/consul/files/consul.service b/app-admin/consul/files/consul.service index be897bcf8e97..7839d7c20a87 100644 --- a/app-admin/consul/files/consul.service +++ b/app-admin/consul/files/consul.service @@ -5,10 +5,13 @@ After=network-online.target [Service] User=consul +Group=consul Environment=CONSUL_AGENT_OPTS="-config-dir=/etc/consul.d" ExecStart=/usr/bin/consul agent $CONSUL_AGENT_OPTS -Restart=on-failure ExecReload=/usr/bin/consul reload +KillMode=process +Restart=on-failure +LimitNOFILE=65536 [Install] WantedBy=default.target -- cgit v1.2.3-65-gdbad