summaryrefslogtreecommitdiff
path: root/app-admin/monit/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-01-08 11:28:34 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-01-08 11:28:34 +0000
commit24fd814c326e282c4321965c31f341dad77e270d (patch)
tree033d63b33c21a3209964ab56005bb9bdd523630d /app-admin/monit/files
parent129160ec854dca4c3fedb5bcfbcb56930371da0f (diff)
gentoo resync : 08.01.2021
Diffstat (limited to 'app-admin/monit/files')
-rw-r--r--app-admin/monit/files/monit-fix-unmonitor.patch27
1 files changed, 27 insertions, 0 deletions
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 000000000000..9e134a08d374
--- /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;