From: "罗百科" <patrick@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/monit/files/, app-admin/monit/
Date: Mon, 4 Jan 2021 12:46:13 +0000 (UTC) [thread overview]
Message-ID: <1609764371.3c27c86eae1512cf9fc782a886cdafd5b8cfff3c.patrick@gentoo> (raw)
commit: 3c27c86eae1512cf9fc782a886cdafd5b8cfff3c
Author: Patrick Lauer <patrick <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 4 12:45:57 2021 +0000
Commit: 罗百科 <patrick <AT> gentoo <DOT> org>
CommitDate: Mon Jan 4 12:46:11 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c27c86e
app-admin/monit: Import upstream fix for unmonitor/stop actions
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Patrick Lauer <patrick <AT> gentoo.org>
app-admin/monit/files/monit-fix-unmonitor.patch | 27 +++++++++++
app-admin/monit/monit-5.27.1-r1.ebuild | 59 +++++++++++++++++++++++++
2 files changed, 86 insertions(+)
diff --git a/app-admin/monit/files/monit-fix-unmonitor.patch b/app-admin/monit/files/monit-fix-unmonitor.patch
new file mode 100644
index 00000000000..9e134a08d37
--- /dev/null
+++ b/app-admin/monit/files/monit-fix-unmonitor.patch
@@ -0,0 +1,27 @@
+From a737d3e3bac5bd0378f645eb675a7e4c248e2216 Mon Sep 17 00:00:00 2001
+From: tildeslash <info@tildeslash.com>
+Date: Tue, 27 Oct 2020 19:53:56 +0100
+Subject: [PATCH] Fixed: Issue #931: The "if oes exist" file test with
+ unmonitor or stop action didn't work properly.
+
+---
+ CHANGES | 9 +++++++--
+ configure.ac | 2 +-
+ src/validate.c | 3 +++
+ system/packages/redhat/monit.spec | 5 ++++-
+ 4 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/src/validate.c b/src/validate.c
+index 2bf818a..36aa7ef 100644
+--- a/src/validate.c
++++ b/src/validate.c
+@@ -1686,6 +1686,9 @@ State_Type check_file(Service_T s) {
+ Event_post(s, Event_Exist, State_Failed, l->action, "file exists");
+ }
+ }
++ // Double-check the monitoring state: the "if does exist" may call unmonitor/stop, which resets the service object
++ if (s->monitor == Monitor_Not)
++ return rv;
+ if (! S_ISREG(s->inf.file->mode) && ! S_ISSOCK(s->inf.file->mode)) {
+ Event_post(s, Event_Invalid, State_Failed, s->action_INVALID, "is neither a regular file nor a socket");
+ return State_Failed;
diff --git a/app-admin/monit/monit-5.27.1-r1.ebuild b/app-admin/monit/monit-5.27.1-r1.ebuild
new file mode 100644
index 00000000000..ae564169cc2
--- /dev/null
+++ b/app-admin/monit/monit-5.27.1-r1.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit bash-completion-r1 pam systemd eutils
+
+DESCRIPTION="Monitoring and managing daemons or similar programs running on a Unix system"
+HOMEPAGE="http://mmonit.com/monit/"
+SRC_URI="http://mmonit.com/monit/dist/${P}.tar.gz"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-linux"
+IUSE="ipv6 libressl pam ssl"
+
+RDEPEND="
+ ssl? (
+ !libressl? ( dev-libs/openssl:0= )
+ libressl? ( dev-libs/libressl:0= )
+ )"
+DEPEND="${RDEPEND}
+ pam? ( sys-libs/pam )"
+BDEPEND="
+ sys-devel/flex
+ sys-devel/bison
+"
+
+PATCHES=( "${FILESDIR}/monit-fix-unmonitor.patch" )
+
+src_prepare() {
+ default
+ sed -i -e '/^INSTALL_PROG/s/-s//' Makefile.in || die
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with ipv6)
+ $(use_with pam)
+ $(use_with ssl)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ insinto /etc; insopts -m600; doins monitrc
+ newinitd "${FILESDIR}"/monit.initd-5.0-r1 monit
+ systemd_dounit "${FILESDIR}"/${PN}.service
+
+ use pam && newpamd "${FILESDIR}"/${PN}.pamd ${PN}
+
+ dobashcomp system/bash/monit
+}
+
+pkg_postinst() {
+ elog "Sample configurations are available at:"
+ elog "http://mmonit.com/monit/documentation/"
+}
next reply other threads:[~2021-01-04 12:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-04 12:46 罗百科 [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-02-04 20:09 [gentoo-commits] repo/gentoo:master commit in: app-admin/monit/files/, app-admin/monit/ Lars Wendler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1609764371.3c27c86eae1512cf9fc782a886cdafd5b8cfff3c.patrick@gentoo \
--to=patrick@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox